Is there a way in he blueprint…
To add
So that the light goes back on previously state?
Cause if we get a green light…it will stay thst way…
Whilevi want it bsck in the state it was set or off…
I’m not sure, I don’t use the blueprint myself. Maybe @EvertJob can answer this one since he’s the author.
Yeah should be possible. Please let me look into it tonight/tomorrow.
You can create an automation that once the session is finished your lights will go back to your old settings, or you set the light settings in your automation.
automation:
- id: 'f1_restore_lights_after_session'
alias: '[F1] Restore lights after session'
description: Restore light to normal state when the F1 session ends
triggers:
- trigger: state
entity_id: sensor.f1_session_status
from: live
to:
- finished
- finalised
- ended
- break
actions:
- action: light.turn_on
target:
entity_id: light.your_light
data:
brightness_pct: XXX
color_temp: XXX
mode: single
Change light.your_light in your light entity
Change the XXX for your settings
actions:
- action: light.turn_on
target:
entity_id: light.your_light
data:
brightness_pct: XXX
color_temp: XXX
or you can use action: scene.create within your automation to effectively backup your current light state and then restore(reactivate) it when the session is over…this is the approach I’ve taken
Thank You EvertJob…
Curious!
I’ve modified the automation from your excellent Blueprint to do this…creates a scene when session is at pre and then restores it after the session…
Didn’t manage to modify the Blueprint itself (couldn’t get it to work)…took control in HA and just edited the resultant Automation…happy to share it here or on GitHub if of use to you
Thank You too Gav_In!..
Gonna wait for EvertJob his one too
You guys are rocking
Thank You too Braakie!
Some food to apply hu…ty
Ill wait for EvertJob too!
Cause if the lights are off (day time)
Then the light should turnoff to after race…
I have something that does exatly that, but the catch is that it is in Node-Red. I do not use HA automations, but Node-Red, as I find it more easy to use and extremely versatile. I have a reusable subflow that can be reused for many notifications, that flashes light and restores to previous settings & state. Can be customized for number of flashes, duration and color. But I can share it with the community on Tuesday.
So, here is my Flash & restore (pulse lights) subflow that can be used for changing lights when something happens (for example flags). As I said, It is in Node-Red.
You need to adjust the server in the subflow nodes (edit sublow and look for nodes with errors).
No entity is hardcoded, it is done to be fully reusable and universal (if you use it for notifications on a white light, it will just pulsate).
What it does:
- if the target light is on, it changes the color/brightness for a defined delay, for the times defined. In between changes reverts to the original state & settings.
- if the light is off, briefly turns it on, reads the initial settings, performs the flashing of the lights for defined color, brightness, delay, number of times (in between reverts to off state), and after that, briefly powers light back on, applies initial settings and turns it off. Basically restoring previous settings.
- it has an initial color, brightness, loops and delay, BUT it can be overwritten by specific msg (I will give examples below)
- you do not need to add multiple instances of the subflow. One is enough. You can “feed” it with the light you want changed and color, brightness, loops, delay.
The delay is always set in ms.
The subflow:
[{"id":"b7a28e19af902145","type":"subflow","name":"Flash & Restore (pulse lights)","info":"Flashes lights and restores state.\n\n**Wake-Up Strategy:**\n- If a light is OFF, it is briefly turned ON (Wake Up) to read its last known settings.\n- **Fix:** 'Originally Off' lights now restore settings *instantly* (0s transition) to ensure they accept the final Turn Off command without conflict.\n\n**Inputs:**\n- `msg.topic` or `msg.payload.entity_id`\n\n**Overrides:**\n- `msg.color`, `msg.brightness`, `msg.loops`, `msg.delay`","category":"","in":[{"x":40,"y":80,"wires":[{"id":"f91aefb0e0a11889"}]}],"out":[{"x":2480,"y":220,"wires":[{"id":"c7c61a6ec66dd81e","port":0},{"id":"325ac445ce4ee4fe","port":0}]}],"env":[{"name":"default_color","type":"str","value":"red"},{"name":"default_delay","type":"num","value":"500"},{"name":"default_loops","type":"num","value":"4"},{"name":"default_brightness","type":"num","value":"100"}],"meta":{},"color":"#DDAA99"},{"id":"f91aefb0e0a11889","type":"change","z":"b7a28e19af902145","name":"Norm. Input","rules":[{"t":"set","p":"data","pt":"msg","to":"data ? data : {}","tot":"jsonata"},{"t":"set","p":"entity_id","pt":"msg","to":"data.entity_id ? data.entity_id : topic","tot":"jsonata"},{"t":"set","p":"data.entity_id","pt":"msg","to":"entity_id","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":160,"y":80,"wires":[["d9c704da61113f4f"]]},{"id":"b325ea0daf581aa6","type":"api-current-state","z":"b7a28e19af902145","name":"Get Initial State","server":"1e6f6b51.b888b5","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"{{entity_id}}","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"initial","propertyType":"msg","value":"","valueType":"entity"},{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"none","entity_location":"data","override_data":"none","x":800,"y":80,"wires":[["10d1cfee51550386"]]},{"id":"85fe29503dfee4e9","type":"api-call-service","z":"b7a28e19af902145","name":"Flash High","server":"1e6f6b51.b888b5","version":7,"debugenabled":false,"action":"light.turn_on","floorId":[],"areaId":[],"deviceId":[],"entityId":[],"labelId":[],"data":"payload.data","dataType":"msg","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"light","service":"turn_on","x":1290,"y":80,"wires":[["563eff3925a765fb"]]},{"id":"563eff3925a765fb","type":"delay","z":"b7a28e19af902145","name":"","pauseType":"delayv","timeout":"100","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":1440,"y":80,"wires":[["7d7494ca884d7bd4"]]},{"id":"eded6db765c1c366","type":"api-call-service","z":"b7a28e19af902145","name":"Flash OFF","server":"1e6f6b51.b888b5","version":7,"debugenabled":false,"action":"light.turn_off","floorId":[],"areaId":[],"deviceId":[],"entityId":[],"labelId":[],"data":"payload.data","dataType":"msg","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"light","service":"turn_off","x":1810,"y":120,"wires":[["f289051dfd1ecff5"]]},{"id":"f289051dfd1ecff5","type":"delay","z":"b7a28e19af902145","name":"","pauseType":"delayv","timeout":"100","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":1960,"y":80,"wires":[["c11ffbd8074e1ade"]]},{"id":"0553079187eda72e","type":"function","z":"b7a28e19af902145","name":"Calculate Restore","func":"const attr = msg.initial.attributes || {};\nconst currentMode = attr.color_mode;\n\n// If originally off, force 0 transition (instant)\n// This prevents the bulb from ignoring the subsequent 'Turn Off' command\n// while it is fading in.\nlet trans = 1;\nif (msg.originally_off === true) {\n trans = 0;\n}\n\nlet serviceData = {\n entity_id: msg.entity_id,\n transition: trans\n};\n\n// 1. Restore Brightness\nif (attr.brightness) {\n serviceData.brightness = parseInt(attr.brightness);\n}\n\n// 2. Restore Color (Respecting Mode)\nif (currentMode === \"color_temp\" && attr.color_temp) {\n serviceData.color_temp = attr.color_temp;\n} else if (currentMode === \"xy\" && attr.xy_color) {\n serviceData.xy_color = attr.xy_color;\n} else if (currentMode === \"hs\" && attr.hs_color) {\n serviceData.hs_color = attr.hs_color;\n} else if (attr.rgb_color) {\n serviceData.rgb_color = attr.rgb_color;\n} else if (attr.color_temp) {\n serviceData.color_temp = attr.color_temp;\n}\n\nmsg.payload = { data: serviceData };\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":1610,"y":220,"wires":[["c7c61a6ec66dd81e"]]},{"id":"c7c61a6ec66dd81e","type":"api-call-service","z":"b7a28e19af902145","name":"Restore Settings","server":"1e6f6b51.b888b5","version":7,"debugenabled":false,"action":"light.turn_on","floorId":[],"areaId":[],"deviceId":[],"entityId":[],"labelId":[],"data":"payload.data","dataType":"msg","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"light","service":"turn_on","x":1850,"y":220,"wires":[["33696ff3cdec3c22"]]},{"id":"33696ff3cdec3c22","type":"switch","z":"b7a28e19af902145","name":"Originally Off?","property":"originally_off","propertyType":"msg","rules":[{"t":"true"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":2040,"y":220,"wires":[["b7910b743e693945"],[]]},{"id":"325ac445ce4ee4fe","type":"api-call-service","z":"b7a28e19af902145","name":"Turn Off","server":"1e6f6b51.b888b5","version":7,"debugenabled":false,"action":"light.turn_off","floorId":[],"areaId":[],"deviceId":[],"entityId":[],"labelId":[],"data":"payload.data","dataType":"msg","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"light","service":"turn_off","x":2500,"y":160,"wires":[[]]},{"id":"b7910b743e693945","type":"delay","z":"b7a28e19af902145","name":"Buffer","pauseType":"delay","timeout":"100","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":2160,"y":220,"wires":[["5c65e3325325ff73"]]},{"id":"5c65e3325325ff73","type":"change","z":"b7a28e19af902145","name":"Prep Final Off","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"data\": {\"entity_id\": entity_id}}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":2320,"y":160,"wires":[["325ac445ce4ee4fe"]]},{"id":"10d1cfee51550386","type":"change","z":"b7a28e19af902145","name":"Process Config","rules":[{"t":"set","p":"flash_config.delay","pt":"msg","to":"delay != null ? delay : $env('default_delay')","tot":"jsonata"},{"t":"set","p":"flash_config.loops","pt":"msg","to":"loops != null ? loops : $env('default_loops')","tot":"jsonata"},{"t":"set","p":"flash_config.color","pt":"msg","to":"color != null ? color : $env('default_color')","tot":"jsonata"},{"t":"set","p":"flash_config.brightness","pt":"msg","to":"brightness != null ? brightness : $env('default_brightness')","tot":"jsonata"},{"t":"set","p":"delay","pt":"msg","to":"flash_config.delay","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":960,"y":80,"wires":[["e9c11c2ace7c870a"]]},{"id":"c11ffbd8074e1ade","type":"change","z":"b7a28e19af902145","name":"Loop Counter","rules":[{"t":"set","p":"flash_config.loops","pt":"msg","to":"flash_config.loops - 1","tot":"jsonata"},{"t":"delete","p":"payload","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":2120,"y":80,"wires":[["e1a82ac1bec11c3c"]]},{"id":"e1a82ac1bec11c3c","type":"switch","z":"b7a28e19af902145","name":"> 0 ?","property":"flash_config.loops","propertyType":"msg","rules":[{"t":"gt","v":"0","vt":"num"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":2270,"y":80,"wires":[["e9c11c2ace7c870a"],["0553079187eda72e"]]},{"id":"7d7494ca884d7bd4","type":"switch","z":"b7a28e19af902145","name":"Initially On?","property":"originally_off","propertyType":"msg","rules":[{"t":"false"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":1570,"y":80,"wires":[["7452af3cda455bd3"],["ebc37cc105353037"]]},{"id":"7452af3cda455bd3","type":"function","z":"b7a28e19af902145","name":"Prep Pulse","func":"const attr = msg.initial.attributes;\nconst currentMode = attr.color_mode;\n\nlet serviceData = {\n entity_id: msg.entity_id,\n transition: 0\n};\n\n// 1. Restore Brightness\nif (attr.brightness) {\n serviceData.brightness = parseInt(attr.brightness);\n}\n\n// 2. Restore Color (Respecting Mode)\nif (currentMode === \"color_temp\" && attr.color_temp) {\n serviceData.color_temp = attr.color_temp;\n} else if (currentMode === \"xy\" && attr.xy_color) {\n serviceData.xy_color = attr.xy_color;\n} else if (currentMode === \"hs\" && attr.hs_color) {\n serviceData.hs_color = attr.hs_color;\n} else if (attr.rgb_color) {\n serviceData.rgb_color = attr.rgb_color;\n} else if (attr.color_temp) {\n serviceData.color_temp = attr.color_temp;\n}\n\nmsg.payload = { data: serviceData };\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":1570,"y":40,"wires":[["62ccd8fb11a776c7"]]},{"id":"62ccd8fb11a776c7","type":"api-call-service","z":"b7a28e19af902145","name":"Flash Low (Revert)","server":"1e6f6b51.b888b5","version":7,"debugenabled":false,"action":"light.turn_on","floorId":[],"areaId":[],"deviceId":[],"entityId":[],"labelId":[],"data":"payload.data","dataType":"msg","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"light","service":"turn_on","x":1770,"y":40,"wires":[["f289051dfd1ecff5"]]},{"id":"e9c11c2ace7c870a","type":"function","z":"b7a28e19af902145","name":"Prep Flash","func":"const attr = msg.initial.attributes || {};\nconst supported = attr.supported_color_modes || [];\n\n// Check for Color Capability\n// 'hs', 'xy', 'rgb', 'rgbw', 'rgbww'\nconst hasColor = supported.some(m => ['hs', 'xy', 'rgb', 'rgbw', 'rgbww'].includes(m));\n\n// Base flash payload\nlet payload = {\n entity_id: msg.entity_id,\n transition: 0, // Force instant for sharp flash and ready for OFF command\n brightness_pct: msg.flash_config.brightness\n};\n\nif (hasColor) {\n // It is RGB, we can send color name\n payload.color_name = msg.flash_config.color;\n} else {\n // It is White/Dimmer, sending color_name usually causes errors or no-ops.\n // Just flash brightness.\n}\n\nmsg.payload = { data: payload };\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":1150,"y":80,"wires":[["85fe29503dfee4e9"]]},{"id":"ebc37cc105353037","type":"change","z":"b7a28e19af902145","name":"Prep Off","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"data\": {\"entity_id\": entity_id}}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1680,"y":120,"wires":[["eded6db765c1c366"]]},{"id":"d9c704da61113f4f","type":"api-current-state","z":"b7a28e19af902145","name":"Check Status","server":"1e6f6b51.b888b5","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"{{entity_id}}","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"status","propertyType":"msg","value":"","valueType":"entityState"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"none","entity_location":"data","override_data":"none","x":300,"y":80,"wires":[["fa816c98677982bb"]]},{"id":"fa816c98677982bb","type":"switch","z":"b7a28e19af902145","name":"State?","property":"status","propertyType":"msg","rules":[{"t":"eq","v":"off","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":440,"y":80,"wires":[["c97907a86e379c92"],["98d593addaeb1cb7"]]},{"id":"c97907a86e379c92","type":"api-call-service","z":"b7a28e19af902145","name":"Wake Up","server":"1e6f6b51.b888b5","version":7,"debugenabled":false,"action":"light.turn_on","floorId":[],"areaId":[],"deviceId":[],"entityId":[],"labelId":[],"data":"{\t \"entity_id\": entity_id\t}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"light","service":"turn_on","x":580,"y":60,"wires":[["641a5c853ca619e8"]]},{"id":"641a5c853ca619e8","type":"delay","z":"b7a28e19af902145","name":"Wait","pauseType":"delay","timeout":"500","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":700,"y":60,"wires":[["4d4467b4347776bf"]]},{"id":"4d4467b4347776bf","type":"change","z":"b7a28e19af902145","name":"Flag Off","rules":[{"t":"set","p":"originally_off","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":660,"y":100,"wires":[["b325ea0daf581aa6"]]},{"id":"98d593addaeb1cb7","type":"change","z":"b7a28e19af902145","name":"Flag On","rules":[{"t":"set","p":"originally_off","pt":"msg","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":660,"y":140,"wires":[["b325ea0daf581aa6"]]},{"id":"1e6f6b51.b888b5","type":"server","name":"Home Assistant Legi","addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"","connectionDelay":false,"cacheJson":false,"heartbeat":false,"heartbeatInterval":"","areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"","enableGlobalContextStore":false},{"id":"ee0ac9f830805ed9","type":"subflow:b7a28e19af902145","z":"520ea6df5c7e3826","g":"dd05c61da726fb2c","name":"","x":700,"y":2300,"wires":[[]]},{"id":"ceb92dc68c480fbb","type":"global-config","env":[],"modules":{"node-red-contrib-home-assistant-websocket":"0.80.3"}}]
Usage:
- you have to have a “current state” node for the light you want to target
- for your settings, you need a “change node” to define the messages for brightness, loop, color and delay
Example of change node:
[{"id":"61606816fabfa160","type":"change","z":"520ea6df5c7e3826","g":"dd05c61da726fb2c","name":"set notif specifics","rules":[{"t":"set","p":"loops","pt":"msg","to":"3","tot":"num"},{"t":"set","p":"color","pt":"msg","to":"yellow","tot":"str"},{"t":"set","p":"delay","pt":"msg","to":"1000","tot":"num"},{"t":"set","p":"brightness","pt":"msg","to":"66","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":430,"y":2380,"wires":[["ee0ac9f830805ed9"]]}]
Example of how I have it for multiple notifications (washer/dryer done - flash blue 5 times 250 ms delay, Doorbell - flash orange 5 times 100ms delay etc). Flows that trigger the behavior are across multiple flows (tabs), connected with “link in” and “link out” nodes.
Hi, it’s possible to make a card for the next week ? A real time championship driver classement.
I will try to write this.
Did anyone get this working with a Yeelight bulb? LAN mode is enabled, but the bulb isn’t responding to actions.
When i copy your code for the last race this is the following error i get. Any ideas?
TypeError: can’t access property “attributes”, entity is undefined in ‘const race = entity.attributes?.race_name || ‘Last Race’; const round = entity.attributes?.round…’
and when i try and do the season calender i get
Race calender not available
Welcome to the community!
Your question is off topic, since it seems unrelated to this one. It would be better to post a new topic for help.
Hi everyone,
What a season we’ve had, always exciting when it goes down to the final race.
A lot has happened with my F1 Sensor integration during the year, especially the implementation of the Live Timing API, which now brings real-time session data directly into Home Assistant. Development has been ongoing throughout the season, and I’m now looking ahead to what we can improve for next year.
This is where I need your input.
What kind of live data would you like to have available in Home Assistant during an active session, and how would you plan to use it?
Your ideas will help me prioritise what to focus on, what brings the most value, and what fun features we can build together.
Looking forward to your thoughts.
What Ive seen others do is to color the lights according to the team color that is ahead in the race. (Is Papaya a known preset?
).
Personlly I’d like an easier way to sync the live data with the TV. For qualifying the tv shows the session time, that is the easiest way to sync. I use that to sync the live timings in the official app. For races the only sync points are the start (but then I’m too focused on the screen) or the lap number changing on screen. A button you can press when that happens would be great.
I have lights follow track status. I did notice though they sometimes change outside of the race or practice, which is cumbersome to filter out. It would be nice is there was a status for when nothing is going on.
I do not have a clear picture on how data was presented so far, but I could imagine a track position, lap times etc. ordered by driver could also be nice. I think how you’d have to scan the list to find your favorite driver? That way you can make automations on your favorite drivers takeovers in case the camera is on another car.



