There are quite a few NUCs floating around on Facebook Marketplace. I picked up an older Celeron based NUC for about R1000 about a year ago and haven't had a day's issue.I recommend a mini pc over a Pi.
Go here: https://www.takealot.com/computers/mini-pc-27164?sort=Price Ascending
Choose one that fit your budget best, however if you can, try at minimum to get the Intel NUC.
You will thank me later, when it just works with HA without SD cards corrupting etc. By the time you have a SSD on your Pi and got over the Pi stock availability issues, not to mention all the additional stuff like power adapter case, etc you need just to turn it on, you might as well have paid for the NUC.
Don't use WindowsWhat do you guys do for the windows restart for updates?
Ditto eBay.There are quite a few NUCs floating around on Facebook Marketplace. I picked up an older Celeron based NUC for about R1000 about a year ago and haven't had a day's issue.
Running HA, plex, Adguard and some other apps on it and the Celeron has plenty juice for those.
Also running 2. On friday switch to esp32 as esp8266 has a limitation with memory.You have 2 options.
1. (expensive) buy envisalink and use envisalink integration
2. (cheaper) use an ESP8266 with ESPHome that you build: https://github.com/Dilbert66/esphome-dsckeybus
HA also has to restart when you upgrade it etc so its much of a muchness. Previously I was running mine on a Windows PC in a VM and had the VM boot as soon as Windows restarted... never had issues. I might actually move back to a VM from the Pi if I can upgrade my processor to an i7 (same machine is running Plex, Blue Iris and the *arr suite)What do you guys do for the windows restart for updates?
HA also has to restart when you upgrade it etc so its much of a muchness. Previously I was running mine on a Windows PC in a VM and had the VM boot as soon as Windows restarted... never had issues. I might actually move back to a VM from the Pi if I can upgrade my processor to an i7 (same machine is running Plex, Blue Iris, Unifi Controller and the *arr suite)What do you guys do for the windows restart for updates?
Tinuva- This is an old post, but do you perhaps have an export of the NodeRed flow that integrates with loadshedding.yaml package. In your text above: "Node-red manages the 3 inputs. Sometimes it gets CoCT's loadshedding level correct, if not it will be the same as eskom." If possible, I want to see how you determine the COCT Loadshedding Stage.Well I think I got the logic right for my very 1st loadshedding slot work-around to....work.
I started with the pool pump, and will later today also do it for some of my other timers like the geysers.
So I have a loadshedding.yaml package with the following:
Code:input_number: loadshedding_stage_eskom: name: Eskom Loadshedding Stage min: -100 max: 8 loadshedding_stage_coct: name: CoCT Loadshedding Stage min: -100 max: 8 input_boolean: loadshedding_slot_active: name: Loadshedding slot active timer: loadshedding_slot: duration: '02:35:00' automation: - alias: start_loadshedding_slot_timer trigger: - platform: state entity_id: input_boolean.loadshedding_slot_active to: 'on' - platform: numeric_state entity_id: input_number.loadshedding_stage_coct above: 0 condition: # make sure timer not already active - condition: state entity_id: timer.loadshedding_slot state: 'idle' # check conditions for both tiggers - condition: state entity_id: input_boolean.loadshedding_slot_active state: 'on' - condition: numeric_state entity_id: input_number.loadshedding_stage_coct above: 0 action: - service: timer.start data: entity_id: timer.loadshedding_slot
Node-red manages the 3 inputs. Sometimes it gets CoCT's loadshedding level correct, if not it will be the same as eskom. Loadshedding slot active can be used, but my other automations will be based on events from the timer.
Anyways, so here is what my pool pump package look like now:
Code:input_datetime: pool_pump_on_time: name: Pool pump on time has_date: false has_time: true timer: pool_pump: name: Pool pump duration: '03:00:00' automation: # Pool pump on based on input time - alias: Turn on pool pump trigger: platform: template value_template: "{{ states('sensor.time') == (state_attr('input_datetime.pool_pump_on_time', 'timestamp') | int | timestamp_custom('%H:%M', False)) }}" condition: - condition: state entity_id: timer.loadshedding_slot state: 'idle' action: - service: switch.turn_on data: entity_id: switch.pool_pump - service: timer.start data_template: entity_id: timer.pool_pump duration: > {% set day_names = [ 'monday', 'tuesday', 'wednesday','thursday','friday','saturday','sunday'] %} {% set today_name = day_names[now().weekday()] %} {% if today_name == 'sunday' %}{{ 300 | int * 60 }} {% else %}{{ 300 | int * 60 }}{% endif -%} # pool pump off when timer finish - alias: Turn off pool pump trigger: - platform: event event_type: timer.finished event_data: entity_id: timer.pool_pump action: - service: switch.turn_off data: entity_id: switch.pool_pump # Loadshedding work-arounds # When in loadshedding, start timer and pause - alias: Turn on pool pump timer in loadshedding trigger: platform: template value_template: "{{ states('sensor.time') == (state_attr('input_datetime.pool_pump_on_time', 'timestamp') | int | timestamp_custom('%H:%M', False)) }}" condition: - condition: state entity_id: timer.loadshedding_slot state: 'active' action: - service: timer.start data_template: entity_id: timer.pool_pump duration: > {% set day_names = [ 'monday', 'tuesday', 'wednesday','thursday','friday','saturday','sunday'] %} {% set today_name = day_names[now().weekday()] %} {% if today_name == 'sunday' %}{{ 300 | int * 60 }} {% else %}{{ 300 | int * 60 }}{% endif -%} # Waits 1 seconds - delay: '00:00:01' - service: timer.pause data_template: entity_id: timer.pool_pump # Resume pool pump after loadshedding finished - alias: Turn on pool pump after loadshedding slot ended trigger: - platform: event event_type: timer.finished event_data: entity_id: timer.loadshedding_slot condition: - condition: state entity_id: timer.pool_pump state: 'paused' action: # Starts or restarts a timer with the provided duration. # If no duration is given, it will either restart with its initial # value, or continue a paused timer with the remaining duration. - service: timer.start data: entity_id: timer.pool_pump - service: switch.turn_on data: entity_id: switch.pool_pump # Pause pool pump if loadshedding slot started - alias: Pause pool pump if loadshedding slot started trigger: - platform: event event_type: timer.started event_data: entity_id: timer.loadshedding_slot condition: - condition: state entity_id: timer.pool_pump state: 'active' action: - service: timer.pause data: entity_id: timer.pool_pump - service: switch.turn_off data: entity_id: switch.pool_pump
Maybe it can help someone else who also needs to do this, or even better yet, tell me how to do it better!
I abondonded that, it was from another loadshedding app/website which stopped working. Sorry I don't have better news on thisTinuva- This is an old post, but do you perhaps have an export of the NodeRed flow that integrates with loadshedding.yaml package. In your text above: "Node-red manages the 3 inputs. Sometimes it gets CoCT's loadshedding level correct, if not it will be the same as eskom." If possible, I want to see how you determine the COCT Loadshedding Stage.
any MQTT experts that can help me please. I have flashed a 2 Channel Relay with Tasmota and now want to use the GPIO14 with a door contact to read the status of the gate.
I have seen some videos on the MQTT topics but don't think they apply to my config since I have 2 relays and want to use the GPOI14 as switch.
any one that can help with the correct MQTT setting to make sure the switch is separate from the relays? and what the config will look like to add it on a card. Already have the 2 Relays sorted and in HA.
Switch:
- platform: mqtt
Name: "Gate_Status"
state_topic: cmd/gatestatus/POWER
command_topic: cmd/gatestatus/POWER
availability_topic: cmd/gatestatus/LWT
payload_open: "ON"
payload_close: "ON"
payload_stop: "ON"
state_open: "OPEN"
state_closed: "CLOSED"
payload_available: "Online"
payload_not_available: "Offline"
optimistic: false
retain: false
shouldnt 'switch' be lowercase? and shouldnt the topics be in " ", e.g.:I have done the topics in Tasmota already thanks a million.
Quick questions.
the topic for the 2 relays are POWER1 and POWER2 so i think the switch will be POWER
so that state topic needs to change as well correct? and then I am not sure about the availability topic? "tasmota_0299AC" is that just the device name I replace. so it should look like the below maybe? if I add it as a sensor it does not work seems like only "Switch" works
Edit: Actually the below does not work. getting error "Switch integration not found" same if I use "cover"
Code:Switch: - platform: mqtt Name: "Gate_Status" state_topic: cmd/gatestatus/POWER command_topic: cmd/gatestatus/POWER availability_topic: cmd/gatestatus/LWT payload_open: "ON" payload_close: "ON" payload_stop: "ON" state_open: "OPEN" state_closed: "CLOSED" payload_available: "Online" payload_not_available: "Offline" optimistic: false retain: false
switch:
- platform: mqtt
Name: "Gate_Status"
state_topic: "cmd/gatestatus/POWER"
That makes sense since that is a cover template. not a switch template.lower case swtich does not work. cover does. Topics dont need to be in " "
Yeah you need 2 different mqtt devices, even if it is 1 physical device, it is 2 different logical devices in home assistant.what I am not sure about is the state_topic (POWER2) and command topic (POWER)? that @SauRoNZA has in his posted code.
state_topic is when you want the state of this cover to show that of the POWER2 topic correct? Meaning State of this cover = state of the POWER2
I want it to function on its own since it is a door contact it has its own topic of POWER, that is setup in the tasmota console.
so my code should be right?
Why not a mqtt sensor? It doesnt need to be a switch. Sensor is all you need to know the state.okay so then it needs to be a switch because I do not want to combine it.
I have already decoupled the GPIO14 (switch 2) on the tasmota console.
I now just need to get the switch into HA.
cover:
# Front property gate
- platform: mqtt
device_class: gate
state_topic: "stat/front-gate/POWER2" #SwitchTopic Enabled
command_topic: "cmnd/front-gate/POWER1"
availability_topic: "tele/front-gate/LWT"
name: "Front Gate"
qos: 0
retain: false
payload_open: "ON"
payload_close: "ON"
payload_stop: "ON"
state_open: "ON"
state_closed: "OFF"
payload_available: "Online"
payload_not_available: "Offline"