Last Updated or created 2024-01-31
I’ve posted about some integrations here:
There are three kinds of 433 connections I’m using:
- Switches
- Sensors (read-only)
- Dimmers
Mqtt Home Assistant Config Yaml
Here are 3 mqtt examples using the Node-Red rewriter (see above post)
mqtt: light: - name: "KitchenOutside" payload_on: "99" payload_off: "0" unique_id: "KitchenOutside" brightness_scale: "99" brightness_state_topic: ha433/kitchenoutside/brightcontrolstate brightness_command_topic: ha433/kitchenoutside/brightcontrol state_topic: ha433/kitchenoutside/brightcontrolstate command_topic: ha433/kitchenoutside/control optimistic: false on_command_type: brightness binary_sensor: - name: "AtelierDoor" state_topic: "home2/3331/payload" value_template: "{{ value_json.nvalue }}" off_delay: 5 payload_off: "0" sensor: - name: "LivingTemperature" state_topic: "home/9999/payload" unit_of_measurement: "°C" value_template: "{{ value_json.svalue1 }}" - name: "LivingHumidity" state_topic: "home/9999/payload" unit_of_measurement: "%" value_template: "{{ value_json.svalue2 }}"
Here is a virtual switch sensor using curl commands
command_line: - switch: name: PatioSlinger command_on: > curl "http://domoticz:pass@192.168.1.1:8080/json.htm?type=command¶m=switchlight&idx=6&switchcmd=On" command_off: > curl "http://domoticz:pass@192.168.1.1:8080/json.htm?type=command¶m=switchlight&idx=6&switchcmd=Off" command_state: > curl "http://domoticz:pass@192.168.1.1:8080/json.htm?type=command¶m=getdevices&rid=6" | grep Status | cut -f4 -d\" value_template: > # "{{ value_json.result[0].Status }}" "{{ value_json.result[0].Status == 'On'}}" icon: > {% if value_json.result[0].Status == 'On' %} mdi:toggle-switch {% else %} mdi:toggle-switch-off {% endif %} - switch: name: DoorChimeManual command_on: > curl "http://domoticz:pass@192.168.1.1:8080/json.htm?type=command¶m=switchlight&idx=9999&switchcmd=On"
Nodered mqtt payload rewriter for dimmer
Note: I still need to write the state part
Function code
var idx = 9999; var bright = msg.payload; msg.payload = {}; msg.payload = {"command": "switchlight", "idx": idx, "switchcmd": "Set Level", "level": bright}; return msg;