Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#input_number:
# start_of_day_vix:
# name: Start of Day VIX
# min: 0
# max: 1000000
counter:
start_of_day_count:
name: Rob Start of Day Count
minimum: 0
maximum: 1000000
sensor:
- platform: template
sensors:
important_sensor:
friendly_name: Rob Important Sensor
value_template: 500
relative_sensor:
friendly_name: Rob Relative Sensor
value_template: "{{ (states.sensor.important_sensor.state | int) - (states.counter.start_of_day_count.state | int) }}"
[{"id":"1b91f7bf.137638","type":"tab","label":"StartOfDay","disabled":false,"info":""},{"id":"8a622b54.ace3d8","type":"inject","z":"1b91f7bf.137638","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"10 22 * * *","once":false,"onceDelay":0.1,"x":110,"y":720,"wires":[["731ac220.3e79ec"]]},{"id":"aed13cc9.f7d4e","type":"api-current-state","z":"1b91f7bf.137638","name":"","server":"6d8c6825.af9008","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"sensor.important_sensor","state_type":"num","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":350,"y":40,"wires":[["d70ab18e.cc09a"]]},{"id":"d587e338.61a8e","type":"inject","z":"1b91f7bf.137638","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":100,"y":40,"wires":[["aed13cc9.f7d4e"]]},{"id":"d70ab18e.cc09a","type":"debug","z":"1b91f7bf.137638","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":410,"y":120,"wires":[]},{"id":"f0a528c3.0c11c8","type":"api-call-service","z":"1b91f7bf.137638","name":"","server":"6d8c6825.af9008","version":1,"debugenabled":false,"service_domain":"counter","service":"configure","entityId":"counter.start_of_day_count","data":"payload","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":true,"x":380,"y":440,"wires":[[]]},{"id":"c099de50.064","type":"inject","z":"1b91f7bf.137638","name":"","topic":"","payload":"{\"value\": 100}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":480,"wires":[["f0a528c3.0c11c8","a4a65349.cf377"]]},{"id":"a4a65349.cf377","type":"debug","z":"1b91f7bf.137638","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload.value","targetType":"msg","x":390,"y":560,"wires":[]},{"id":"4c0a2727.ef0318","type":"inject","z":"1b91f7bf.137638","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":100,"y":240,"wires":[["483df92c.460898"]]},{"id":"483df92c.460898","type":"api-current-state","z":"1b91f7bf.137638","name":"","server":"6d8c6825.af9008","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"sensor.relative_sensor","state_type":"num","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":370,"y":280,"wires":[["c315e72d.f30878"]]},{"id":"c315e72d.f30878","type":"debug","z":"1b91f7bf.137638","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":410,"y":340,"wires":[]},{"id":"7f24d369.9ad80c","type":"function","z":"1b91f7bf.137638","name":"","func":"msg.payload = {\n value: msg.payload\n}\nreturn msg;","outputs":1,"noerr":0,"x":190,"y":860,"wires":[["866f51c8.c992e"]]},{"id":"5f032c34.e0ab14","type":"inject","z":"1b91f7bf.137638","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":100,"y":160,"wires":[["3adbeee1.4c0252"]]},{"id":"3adbeee1.4c0252","type":"api-current-state","z":"1b91f7bf.137638","name":"","server":"6d8c6825.af9008","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"counter.start_of_day_count","state_type":"num","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":340,"y":160,"wires":[["805767f1.f24fe8"]]},{"id":"805767f1.f24fe8","type":"debug","z":"1b91f7bf.137638","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":390,"y":220,"wires":[]},{"id":"731ac220.3e79ec","type":"api-current-state","z":"1b91f7bf.137638","name":"","server":"6d8c6825.af9008","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"sensor.important_sensor","state_type":"num","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":250,"y":780,"wires":[["7f24d369.9ad80c"]]},{"id":"866f51c8.c992e","type":"api-call-service","z":"1b91f7bf.137638","name":"","server":"6d8c6825.af9008","version":1,"debugenabled":false,"service_domain":"counter","service":"configure","entityId":"counter.start_of_day_count","data":"payload","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":true,"x":300,"y":980,"wires":[["f39580a5.b6109"]]},{"id":"f39580a5.b6109","type":"debug","z":"1b91f7bf.137638","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload.value","targetType":"msg","x":430,"y":1060,"wires":[]},{"id":"6d8c6825.af9008","type":"server","z":"","name":"Home Assistant","legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":false,"cacheJson":false}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.