Virtual Fireplace
WLED
check these * WLED * WLED install
Components
For this project I used White PCB with IP65 and 5m 150leds .. pick what suites your needs. (also got 5m 300leds which I'll use elsewhere) and punch of SK6812 leds which have separate white pixel aswell.
Calculate your power need based on the amount of leds you are going to use example with strip of 2 meters which has 30leds/m each led max power is 0.3W. 2x30 = 60 leds. 60*0.3W = 18W .. pick something higher than that to be on thesafe side.
- WS2812B Eco All LED - White PCB with IP65 and 5m 150leds
- Power Supply - 25W version is more than enough for my 170cm cut.
- D1 Mini NodeMCU but you can go with ESP32 as well, should be more powerful if you use more leds.
WLED Fireplace Preset
Used the ColorTwinkles as the base and tuned speeds and colors
API Command
{"on":true,"bri":255,"transition":7,"mainseg":0,"seg":[{"id":0,"start":0,"stop":52,"grp":1,"spc":0,"of":0,"on":true,"frz":false,"bri":255,"cct":127,"set":0,"col":[[255,160,0],[0,0,0],[0,0,0]],"fx":74,"sx":56,"ix":139,"pal":3,"c1":128,"c2":128,"c3":16,"sel":true,"rev":false,"mi":false,"o1":false,"o2":false,"o3":false,"si":0,"m12":0},{"stop":0},{"stop":0},{"stop":0},{"stop":0},{"stop":0},{"stop":0},{"stop":0},{"stop":0},{"stop":0},{"stop":0},{"stop":0},{"stop":0},{"stop":0},{"stop":0},{"stop":0}]}
NodeRED Automation
Fireplace is turning on and off only automatically based on room occupancy, TV state, and room brightness and ceiling light brigtness.
"Timeout" helper - Fireplace Fade Timeout - delays the turn off, controls how long the fireplace is still on, when turn off is called. Delay is reset if turn on is called.
- Room Occupancy - someone has to be in the room for it to turn on.
- TV state - if TV is ON, it will be off. Doesn't then mess with the TV ambilight.
- Room Brightness - if room brightness is above certain level it won't turn on (and if ceiling light brightness is above certain level)
Node-Red JSON Flow
[
{
"id": "0813a117fe43e434",
"type": "server-state-changed",
"z": "68c7aeaac5528913",
"name": "TV Power",
"server": "dba636d5.d235b8",
"version": 5,
"outputs": 2,
"exposeAsEntityConfig": "",
"entityId": "media_player.70pus9005_12_2",
"entityIdType": "exact",
"outputInitially": true,
"stateType": "str",
"ifState": "on",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": 0,
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": false,
"ignorePrevStateUnavailable": false,
"ignoreCurrentStateUnknown": false,
"ignoreCurrentStateUnavailable": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "data",
"propertyType": "msg",
"value": "",
"valueType": "eventData"
},
{
"property": "topic",
"propertyType": "msg",
"value": "",
"valueType": "triggerId"
}
],
"x": 200,
"y": 5760,
"wires": [
[
"989ef02789918122"
],
[
"6ec51bd42b29d14f"
]
]
},
{
"id": "989ef02789918122",
"type": "change",
"z": "68c7aeaac5528913",
"name": "off",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "off",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 730,
"y": 5820,
"wires": [
[
"f83f049b86ed3afd"
]
]
},
{
"id": "6ec51bd42b29d14f",
"type": "api-current-state",
"z": "68c7aeaac5528913",
"name": "Ceiling Light",
"server": "dba636d5.d235b8",
"version": 3,
"outputs": 2,
"halt_if": "on",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "light.living_room_ceiling_light",
"state_type": "str",
"blockInputOverrides": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "data",
"propertyType": "msg",
"value": "",
"valueType": "entity"
}
],
"for": "0",
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 390,
"y": 5840,
"wires": [
[
"9b37b53aa6b7e0f9"
],
[
"2686e4fe3b0aef18"
]
]
},
{
"id": "8878a1d202d3df7b",
"type": "switch",
"z": "68c7aeaac5528913",
"name": "Brightness",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "lt",
"v": "145",
"vt": "num"
},
{
"t": "gte",
"v": "145",
"vt": "num"
}
],
"checkall": "false",
"repair": false,
"outputs": 2,
"x": 530,
"y": 5680,
"wires": [
[
"2686e4fe3b0aef18"
],
[
"989ef02789918122"
]
]
},
{
"id": "f83f049b86ed3afd",
"type": "api-current-state",
"z": "68c7aeaac5528913",
"name": "TV Desk WLED On",
"server": "dba636d5.d235b8",
"version": 3,
"outputs": 2,
"halt_if": "on",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "light.wled_2",
"state_type": "str",
"blockInputOverrides": false,
"outputProperties": [],
"for": "0",
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 790,
"y": 5920,
"wires": [
[
"a3b16db60ddd4e9d"
],
[]
]
},
{
"id": "d9538bf7d521e8b1",
"type": "server-state-changed",
"z": "68c7aeaac5528913",
"name": "Ceiling Light",
"server": "dba636d5.d235b8",
"version": 5,
"outputs": 1,
"exposeAsEntityConfig": "",
"entityId": "light.living_room_ceiling_light",
"entityIdType": "exact",
"outputInitially": true,
"stateType": "str",
"ifState": "",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": false,
"for": "0",
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": false,
"ignorePrevStateUnavailable": false,
"ignoreCurrentStateUnknown": false,
"ignoreCurrentStateUnavailable": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "data",
"propertyType": "msg",
"value": "",
"valueType": "eventData"
},
{
"property": "topic",
"propertyType": "msg",
"value": "",
"valueType": "triggerId"
}
],
"x": 170,
"y": 5840,
"wires": [
[
"6ec51bd42b29d14f"
]
]
},
{
"id": "43056a7be9a531a8",
"type": "server-state-changed",
"z": "68c7aeaac5528913",
"name": "FP2 Occupancy",
"server": "dba636d5.d235b8",
"version": 5,
"outputs": 2,
"exposeAsEntityConfig": "",
"entityId": "binary_sensor.living_room_fp2_sensor",
"entityIdType": "exact",
"outputInitially": true,
"stateType": "str",
"ifState": "on",
"ifStateType": "str",
"ifStateOperator": "is",
"outputOnlyOnStateChange": true,
"for": 0,
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": false,
"ignorePrevStateUnavailable": false,
"ignoreCurrentStateUnknown": false,
"ignoreCurrentStateUnavailable": false,
"outputProperties": [
{
"property": "payload",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "data",
"propertyType": "msg",
"value": "",
"valueType": "eventData"
},
{
"property": "topic",
"propertyType": "msg",
"value": "",
"valueType": "triggerId"
}
],
"x": 200,
"y": 5920,
"wires": [
[
"6ec51bd42b29d14f",
"a3b16db60ddd4e9d"
],
[
"f83f049b86ed3afd"
]
]
},
{
"id": "9b37b53aa6b7e0f9",
"type": "function",
"z": "68c7aeaac5528913",
"name": "get brightness",
"func": "\n//var newbrightness = msg.data.new_state.attributes.brightness\nvar brightness = msg.data.attributes.brightness\n\n//msg.payload = change\nmsg.payload = parseInt(brightness);\nreturn msg;\n",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 500,
"y": 5740,
"wires": [
[
"8878a1d202d3df7b"
]
]
},
{
"id": "2686e4fe3b0aef18",
"type": "change",
"z": "68c7aeaac5528913",
"name": "on",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "on",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 730,
"y": 5760,
"wires": [
[
"7ea6364f03ea3cca",
"a3b16db60ddd4e9d"
]
]
},
{
"id": "a3b16db60ddd4e9d",
"type": "api-current-state",
"z": "68c7aeaac5528913",
"name": "Timeout",
"server": "dba636d5.d235b8",
"version": 3,
"outputs": 1,
"halt_if": "",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "number.fireplace_fade_timeout",
"state_type": "num",
"blockInputOverrides": false,
"outputProperties": [
{
"property": "delay",
"propertyType": "msg",
"value": "",
"valueType": "entityState"
},
{
"property": "data",
"propertyType": "msg",
"value": "",
"valueType": "entity"
}
],
"for": 0,
"forType": "num",
"forUnits": "minutes",
"x": 1100,
"y": 5840,
"wires": [
[
"c901b56f113bc16d"
]
]
},
{
"id": "7ea6364f03ea3cca",
"type": "api-current-state",
"z": "68c7aeaac5528913",
"name": "Occupancy",
"server": "dba636d5.d235b8",
"version": 3,
"outputs": 2,
"halt_if": "on",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "binary_sensor.living_room_fp2_sensor",
"state_type": "str",
"blockInputOverrides": false,
"outputProperties": [],
"for": "0",
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 910,
"y": 5700,
"wires": [
[
"877b067d92a834a7"
],
[]
]
},
{
"id": "c901b56f113bc16d",
"type": "trigger",
"z": "68c7aeaac5528913",
"name": "Delay",
"op1": "",
"op2": "0",
"op1type": "nul",
"op2type": "str",
"duration": "1",
"extend": true,
"overrideDelay": true,
"units": "s",
"reset": "on",
"bytopic": "all",
"topic": "topic",
"outputs": 1,
"x": 1270,
"y": 5840,
"wires": [
[
"f1b688970bc54fe9"
]
]
},
{
"id": "877b067d92a834a7",
"type": "api-current-state",
"z": "68c7aeaac5528913",
"name": "Illuminance <30",
"server": "dba636d5.d235b8",
"version": 3,
"outputs": 2,
"halt_if": "30",
"halt_if_type": "num",
"halt_if_compare": "lt",
"entity_id": "sensor.living_room_fp2_occupancy_light_sensor_light_level",
"state_type": "str",
"blockInputOverrides": false,
"outputProperties": [],
"for": "0",
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 1000,
"y": 5640,
"wires": [
[
"d87bc673a80f05a4"
],
[]
]
},
{
"id": "f1b688970bc54fe9",
"type": "api-call-service",
"z": "68c7aeaac5528913",
"name": "TV desk WLED OFF",
"server": "dba636d5.d235b8",
"version": 5,
"debugenabled": false,
"domain": "light",
"service": "turn_off",
"areaId": [],
"deviceId": [],
"entityId": [
"light.wled_2"
],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"x": 1480,
"y": 5840,
"wires": [
[]
]
},
{
"id": "d87bc673a80f05a4",
"type": "api-current-state",
"z": "68c7aeaac5528913",
"name": "TV is On?",
"server": "dba636d5.d235b8",
"version": 3,
"outputs": 2,
"halt_if": "on",
"halt_if_type": "str",
"halt_if_compare": "is",
"entity_id": "media_player.70pus9005_12_2",
"state_type": "str",
"blockInputOverrides": false,
"outputProperties": [],
"for": "0",
"forType": "num",
"forUnits": "minutes",
"override_topic": false,
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"x": 1120,
"y": 5700,
"wires": [
[],
[
"f3bb6b675138258e"
]
]
},
{
"id": "f3bb6b675138258e",
"type": "function",
"z": "68c7aeaac5528913",
"name": "Fireplace",
"func": "var preset\n\npreset = env.get(\"NR_NODE_NAME\");\n\nmsg.payload = \n{\n \"data\": {\n \"option\": \"\" + preset + \"\",\n }\n}\nreturn msg;",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1280,
"y": 5760,
"wires": [
[
"fdc1b1ef84221ca9"
]
]
},
{
"id": "fdc1b1ef84221ca9",
"type": "api-call-service",
"z": "68c7aeaac5528913",
"name": "TV desk WLED Preset",
"server": "dba636d5.d235b8",
"version": 5,
"debugenabled": false,
"domain": "select",
"service": "select_option",
"areaId": [],
"deviceId": [],
"entityId": [
"select.wled_preset_2"
],
"data": "",
"dataType": "jsonata",
"mergeContext": "",
"mustacheAltTags": false,
"outputProperties": [],
"queue": "none",
"x": 1480,
"y": 5760,
"wires": [
[]
]
},
{
"id": "dba636d5.d235b8",
"type": "server",
"name": "Home Assistant",
"version": 5,
"addon": true,
"rejectUnauthorizedCerts": true,
"ha_boolean": "y|yes|true|on|home|open",
"connectionDelay": true,
"cacheJson": true,
"heartbeat": true,
"heartbeatInterval": "30",
"areaSelector": "friendlyName",
"deviceSelector": "friendlyName",
"entitySelector": "friendlyName",
"statusSeparator": "at: ",
"statusYear": "hidden",
"statusMonth": "short",
"statusDay": "numeric",
"statusHourCycle": "h23",
"statusTimeFormat": "h:m",
"enableGlobalContextStore": true
}
]
