I upgraded my hardware to a tinkerboard from a PI today. Created a snapshot in HASSIO and moved that over and all started to work except my MQTT lights. I created a MQTT entry for this and it sends MQTT topics to my UniPi system where a custom scripts receives the message, takes actions and ack’s a MQTT message back so the light turns yellow in the HassIO GUI.
All works fine except that HASSIO does not accept the response MQTT message on the migrated HASSIO on the thinkerboard, but it does work on the PI (migrated back for now, works again).
Love to hear idea’s here.
MQTT light code is:
- platform: mqtt_template
# based on; https://github.com/bruhautomation/BRUH3-Home-Assistant-Configuration/blob/master/lights/mqtt_lights/jar_leds_template.yaml
name: "Achterdeur light"
state_topic: "homeassistant/buiten/achterdeur/licht"
command_topic: "homeassistant/buiten/achterdeur/licht/set"
availability_topic: "homeassistant/buiten/achterdeur/licht/available"
payload_available: "online"
payload_not_available: "offline"
brightness_state_topic: "homeassistant/buiten/achterdeur/licht/brightness"
command_on_template: >
{"state": "on"
, "circuit": "2_01"
, "dev": "analogoutput"
{%- if brightness is defined -%}
, "brightness": {{ brightness }}
{%- elif brightness is undefined -%}
, "brightness": 100
{%- endif -%}
{%- if effect is defined -%}
, "effect": "{{ effect }}"
{%- endif -%}
{%- if transition is defined -%}
, "transition": {{ transition }}
{%- endif -%}
}
command_off_template: '{"state": "off", "circuit": "2_01", "dev": "analogoutput"}'
state_template: '{{ value_json.state }}'
brightness_template: '{{ value_json.brightness }}'
on_command_type: "brightness"
#red_template: '{{ value_json.color[0] }}'
#green_template: '{{ value_json.color[1] }}'
#blue_template: '{{ value_json.color[2] }}'
#effect_template: '{{ value_json.effect }}'
qos: 0
homebridge_hidden: false
The message that is send and returned is:
{"state": "on" , "circuit": "2_01" , "dev": "analogoutput"}