im a bit confused I must confess.
On P1 i have mosquito installed.
use many sensors platform: mqtt of this type:
- platform: mqtt
state_topic: 'mac_address/powerswitch-zwave/d1978523/usage'
name: "Tester actueel"
unit_of_measurement: "Watt"
- platform: mqtt
state_topic: 'mac_address/powerswitch-zwave/d1978523/power'
name: "Tester totaal"
unit_of_measurement: "kWh"
value_template: "{{ value | round(2) }}"
- platform: mqtt
state_topic: 'mac_address/powerswitch-zwave/d1978523/state'
name: "Tester state"
# unit_of_measurement: "State"
force_update: true
and control switches via the Api:
sw_tester_cl:
friendly_name: Tester (cl)
command_on: >
curl -X POST -d '{"seq":1, "method":"object_prop_set", "arguments":{"oid":"d1978523", "prop":"command", "value":"on"}}' http://ip_address/iungo/api_request
command_off: >
curl -X POST -d '{"seq":1, "method":"object_prop_set", "arguments":{"oid":"d1978523", "prop":"command", "value":"off"}}' http:///ip_address/iungo/api_request
# command_state: >
# curl -X POST -d '{"seq":1, "method":"object_prop_get", "arguments":{"oid":"d1978523", "prop":"state"}}' http:///ip_address/iungo/api_request
value_template: >
{% if value_json.rv.value == 'on' %}
{{ true }}
{% else %}
{{ false }}
{% endif %}
I create several other sensors, binary_sensors, threshold etc etc based on the data gathered with these. No further publishing at all.
On the Pi2 now, i have set the same broker, the one in the P1, and have now added the same switches and sensors in the configuration. They work flawlessly…
I seem not to understand how that can be … the P1 doesn’t publish anything, it merely receives the data from the Z-wave hub. the sensors have the mac address of the zwave hub and the command_line switches use the ip_address. So why would i need the broker in the first place…?
Ive tried to take out the mqtt settings on the P2, but that doesn’t work, so the configuration seems to be in order, its just that I don’t understand the architecture to its fullest.