just looking for a reason why its not functioning
If I toggle the relay locally it moves the switch button on the HA gui, pity it wont work the other way
tnx
Richard
just looking for a reason why its not functioning
If I toggle the relay locally it moves the switch button on the HA gui, pity it wont work the other way
tnx
Richard
Because youāve specified either the wrong command_topic
or payload_on
.
Iāve checked with info given on the iot4.eu website and the state and command topics are the
same
- platform: mqtt
name: "LED"
state_topic: "/iot4/switch/LED/relay/0"
command_topic: "/iot4/switch/LED/relay/0"
payload_on: "1"
payload_off: "0"
#IOT4SH02BLINDER mqtt control topic
- platform: mqtt
name: "Fel"
state_topic: "/iot4/IOT4SH02_BLINDER_828D81/relay/0"
command_topic: "/iot4/IOT4SH02_BLINDER_828D81/relay/0"
payload_on: "1"
payload_off: "0"
I tried the line with LED in and that didnāt function
I have
switch:
- platform: tplink
host: 192.168.1.83
name: LR Lamp
- platform: mqtt
host: 192.168.1.109
name: PIG
state_topic: "/iot4/switch/IOT4SH01RELAY_D341D/relay/0"
command_topic: "/iot4/switch/IOT4SH01RELAY_D341D/relay/0"
payload_on: "1"
payload_off: "0"
the website says
In the state_topic filed insert the root topic which you set, the end tag in the :
state_topic: "/iot4/switch/IOT4SH01DS_122F85/temperature"
IOT4SH01DS is /temperature
IOT4SH01RELAY is /relay/0
IOT4SH01BME is /pressure for the pressure sensor data
IOT4SH01BME is /humidity for the humidity sensor data
IOT4SH01BME is /temperature for the temperature sensor data
IOT4SH01BMP is /pressure for the pressure sensor data
IOT4SH01BMP is /temperature for the temperature sensor data
not sure what else ?
Richard
Hmmmā¦
interestingly, we had a substantively the same interaction in a thread when you first joined in November on this exact topic. And in that thread you eventually managed to figure out how to do it right. but now suddenly you donāt know how to post correctly and get āhacked offā and say thereās nothing you can do about it when people tell you you need to learn to do it so that it helps us to help you?
here is that thread to help jog your memory:
and I canāt tell you how many times Iāve posted this gif in other threads but in case you havenāt seen it here it is again. Hopefully it gives you some help in figuring it out (againā¦):
not sure what you are getting at ??/
NOWHERE on the box at the start does it say to use ```
and my previous posts were on the sensor.
whty not be constructive ???
Richard
I am being constructive. Iām telling you that there are many times that we wonāt be able to help you if you donāt post your code correctly. Either that or we will have to work harder to both figure out your code the way that it is while also trying to decipher your improperly formatted code so we can try to figure out what you are doing in the first place.
Iām trying to help to help you
Yes, your previous thread was on a sensor but we had the same (similarā¦) discussion about the importance of posting code properly and how to do it. Thatās why itās relevant here. And in that thread you figured out how to do it.
So I can only assume at this point you are just willfully not wanting to do it correctly. so you will be the one that might not get the help you need because most people wonāt want to take the time to try to decipher your code especially if it isnāt properly posted just because you wonāt do it.
EDIT to add: if you click the links contained in the blue box above it actually does contain the information about the three back ticks. just an FYI.
If you want our assistance, youāre going to have to follow through on our requests and suggestions. For example, when I stated that host:
is an invalid option for an MQTT switch, I expected you to remove it. Yet in your previous post I still see it shown in the switchās configuration:
switch:
- platform: tplink
host: 192.168.1.83
name: LR Lamp
- platform: mqtt
host: 192.168.1.109 # <---- NO! This is an invalid option.
name: PIG
state_topic: "/iot4/switch/IOT4SH01RELAY_D341D/relay/0"
command_topic: "/iot4/switch/IOT4SH01RELAY_D341D/relay/0"
payload_on: "1"
payload_off: "0"
Examples like the one above give me no confidence that anything we are suggesting is actually being applied. As a consequence, it make me lose interest in continuing to provide assistance.
I just looked at the siteās instructions and the suggestion to set command_topic
and state_topic
to the same topic is, to put it politely, sloppy.
It implies the device has no means of reporting its status so the suggested solution is to make the controlling device (Home Assistant) ālisten to itselfā. Whatever command Home Assistant transmits is echoed back to itself by the broker and not the relay.
Thereās already a way to handle devices that do not report their status and thatās by using optimistic: true
and excluding the state_topic
.
Anyway, what you need to do is confirm that publishing a 1
or 0
to /iot4/IOT4SH01RELAY_D341D/relay/0
can turn it on and off. Go to Home Assistantās MQTT page and enter the relayās topic and set the payload to 1
. Click PUBLISH and see if it turns on the relay.
If that fails then the possibilities are the relay:
/iot4/IOT4SH01RELAY_D341D/relay/0
1
To solve the problem, work your way down through that list of possibilities.
Sorry 123 , I did nāt read properly the note on the host option.
publishing from the gui did not change the switch state
1554313453: Received PUBLISH from home-assistant (d0, q0, r0, m0, '/iot4/switch/IOT4SH01RELAY_D341D/relay/0', ... (1 bytes))
1554313453: Sending PUBLISH to home-assistant (d0, q0, r0, m0, '/iot4/switch/IOT4SH01RELAY_D341D/relay/0', ... (1 bytes))
1554313453: Sending PUBLISH to mosqsub|2122-odroid (d0, q0, r0, m0, '/iot4/switch/IOT4SH01RELAY_D341D/relay/0', ... (1 bytes)
``
deleting the host:entry and restarting the server
same result
1554313806: Received PUBLISH from home-assistant (d0, q0, r0, m0, ā/iot4/switch/IOT4SH01RELAY_D341D/relay/0ā, ā¦ (1 bytes))
1554313806: Sending PUBLISH to mosqsub|2122-odroid (d0, q0, r0, m0, ā/iot4/switch/IOT4SH01RELAY_D341D/relay/0ā, ā¦ (1 bytes))
1554313806: Sending PUBLISH to home-assistant (d0, q0, r0, m0, ā/iot4/switch/IOT4SH01RELAY_D341D/relay/0ā, ā¦ (1 bytes))
``
changing the payload to ON & OFF
1554314130: Received PUBLISH from home-assistant (d0, q0, r0, m0, '/iot4/switch/IOT4SH01RELAY_D341D/relay/0', ... (3 bytes))
1554314130: Sending PUBLISH to mosqsub|2122-odroid (d0, q0, r0, m0, '/iot4/switch/IOT4SH01RELAY_D341D/relay/0', ... (3 bytes))
1554314130: Sending PUBLISH to home-assistant (d0, q0, r0, m0, '/iot4/switch/IOT4SH01RELAY_D341D/relay/0', ... (3 bytes))
there is a delay of about 6 seconds bewteen receiving and sending
my config is now
switch:
- platform: tplink
host: 192.168.1.83
name: LR Lamp
- platform: mqtt
name: PIG
# state_topic: "/iot4/switch/IOT4SH01RELAY_D341D/relay/0"
command_topic: "/iot4/switch/IOT4SH01RELAY_D341D/relay/0"
payload_on: "1"
payload_off: "0"
optimistic: true
the root topic on the mqtt setting on the device are
/iot4/switch/{identifier} Hostname IOT4SH01RELAY_D341D
Iāve tried from The HA publish sending 1,0, ON, OFF, 0x01, 0x00 just incase it would accept a hex number
the log shows its now stopped sending back to homeassistant when switched from the over view switch, but not from publishing a packet
Iāve also tried publishing ā2ā which on his other units just quickly toggle back to the original state.
the relay must be connected to the broker as as change of relay state is sent to HA and it is shown on the HA gui.
Iām not sure of anything else I can put as a payload , open to suggestions.
Defective ??? , I can ask for fresh software as there is a facility to update.
What I dont understand is the time delay from mosquitto receiving published data and
publishing data.
The delay works both ways , infact longer 10secs plue from locally toggling the relay
and mosquitto showing a recieved publish from the relay, it shows no delay publishing to HA
Richard
I have a question for you regarding these messages:
1554314130: Received PUBLISH from home-assistant
1554314130: Sending PUBLISH to mosqsub|2122-odroid
1554314130: Sending PUBLISH to home-assistant
The broker receive the published payload from home-assistant then sent it to two subscribers:
What is mosqsub|2122-odroid? Is that how the relay device identifies itself to the broker? Or is it something else?
The temperature sensor identified itself as esp8266a03625
. I need to know what name the relay device uses.
Its not come from the relay
Its something within mosquitto, this version of mosquitto is
mosquitto version 1.4.15 (build date Wed, 13 Feb 2019 00:27:01 +0000)
At least it wasnāt Friday 13th
It seems to be an intermediate server within mosquitto.
I think the main version of mosquitto is around 1.5 , github says 1.5.8
so that must be a ubuntu build
Iām running linux mint 19.1 on this laptop and the current version here is 1.4.15 and thatās ubuntu 18.04 build.
It looks to be a security fix for password problems where any malformed password was acceptedā¦
sorry I dont know any more than that
Richard
any device called āodroidā wouldnāt be something internal in normal mosquittoā¦there is no āintermediate server within mosquittoā
Based on the brokerās log, it would appear the relay device is either:
If it was connected and subscribed to a topic, the broker would be sending it payloads via the subscribed topic ā¦ but the log shows no record of that happening. The relay deviceās name isnāt listed in the log.
ā¦ or its name is mosqsub|2122-odroid
(but I have my doubts) and isnāt responding to the received payloads.
Anyway, thereās more here than meets the eye. MQTT problems really arenāt that difficult to debug so I canāt help but feel thereās missing information.
Do you have any other software to monitor MQTT such as MQTTFx or MQTT Explorer? If you donāt I recommend getting either if those (MQTT Explorer would be the preferred). Even if they donāt help you here and now they are a great troubleshooting tool for things MQTT related.
Iām pretty sure from your logs posted that the payload should be 0 & 1 for off & on. With an MQTT sniffer/client I think you will be more able to easily prove that.
Is there a way to modify the topics so that you have a separate command and state topic or, since you mentioned being able to get updated firmware, can you put any third party firmware on the device such as Tasmota or ESPHome?
From reading all of this I really think that the lack of a separate state and command topic is the cause of all your woes now.
(homeassistant) odroid@odroid:~/.homeassistant$ sudo netstat -tpan | grep mosquitto
[sudo] password for odroid:
tcp 0 0 0.0.0.0:1883 0.0.0.0:* LISTEN 1971/mosquitto
tcp 0 0 192.168.1.82:1883 192.168.1.82:39988 ESTABLISHED 1971/mosquitto
tcp 0 0 192.168.1.82:1883 192.168.1.110:13993 ESTABLISHED 1971/mosquitto
tcp 0 0 192.168.1.82:1883 192.168.1.109:9207 ESTABLISHED 1971/mosquitto
tcp 0 0 192.168.1.82:1883 192.168.1.82:55867 ESTABLISHED 1971/mosquitto
tcp 0 0 192.168.1.82:39988 192.168.1.82:1883 ESTABLISHED 2122/mosquitto_sub
tcp6 0 0 :::1883 :::* LISTEN 1971/mosquitto
192.168.1.109 is the relay
here a bit from the mosquitto log:-
1554324212: Received PUBLISH from esp8266d341de (d0, q0, r1, m0, 'PIG/app', ... (4 bytes))
1554324212: Sending PUBLISH to mosqsub|2122-odroid (d0, q0, r0, m0, 'PIG/app', ... (4 bytes))
1554324212: Received PUBLISH from esp8266d341de (d0, q0, r1, m0, 'PIG/version', ... (5 bytes))
1554324212: Sending PUBLISH to mosqsub|2122-odroid (d0, q0, r0, m0, 'PIG/version', ... (5 bytes))
1554324212: Received PUBLISH from esp8266d341de (d0, q0, r1, m0, 'PIG/host', ... (3 bytes))
1554324212: Sending PUBLISH to mosqsub|2122-odroid (d0, q0, r0, m0, 'PIG/host', ... (3 bytes))
1554324212: Received PUBLISH from esp8266d341de (d0, q0, r1, m0, 'PIG/ip', ... (13 bytes))
1554324212: Sending PUBLISH to mosqsub|2122-odroid (d0, q0, r0, m0, 'PIG/ip', ... (13 bytes))
1554324212: Received PUBLISH from esp8266d341de (d0, q0, r1, m0, 'PIG/mac', ... (17 bytes))
1554324212: Sending PUBLISH to mosqsub|2122-odroid (d0, q0, r0, m0, 'PIG/mac', ... (17 bytes))
1554324212: Received PUBLISH from esp8266d341de (d0, q0, r1, m0, 'PIG/rssi', ... (3 bytes))
1554324212: Sending PUBLISH to mosqsub|2122-odroid (d0, q0, r0, m0, 'PIG/rssi', ... (3 bytes))
1554324212: Received PUBLISH from esp8266d341de (d0, q0, r1, m0, 'PIG/uptime', ... (4 bytes))
1554324212: Sending PUBLISH to mosqsub|2122-odroid (d0, q0, r0, m0, 'PIG/uptime', ... (4 bytes))
1554324212: Received PUBLISH from esp8266d341de (d0, q0, r1, m0, 'PIG/freeheap', ... (5 bytes))
1554324212: Sending PUBLISH to mosqsub|2122-odroid (d0, q0, r0, m0, 'PIG/freeheap', ... (5 bytes))
1554324212: Received PUBLISH from esp8266d341de (d0, q0, r1, m0, 'PIG/relay/0', ... (1 bytes))
1554324212: Sending PUBLISH to mosqsub|2122-odroid (d0, q0, r0, m0, 'PIG/relay/0', ... (1 bytes))
1554324212: Received PUBLISH from esp8266d341de (d0, q0, r1, m0, 'PIG/vcc', ... (4 bytes))
1554324212: Sending PUBLISH to mosqsub|2122-odroid (d0, q0, r0, m0, 'PIG/vcc', ... (4 bytes))
1554324212: Received PUBLISH from esp8266d341de (d0, q0, r1, m0, 'PIG/status', ... (1 bytes))
1554324212: Sending PUBLISH to mosqsub|2122-odroid (d0, q0, r0, m0, 'PIG/status', ... (1 bytes))
1554324219: Received PINGREQ from esp8266d341de
1554324219: Sending PINGRESP to esp8266d341de
1554324220: Received PINGREQ from mosqsub|2122-odroid
1554324220: Sending PINGRESP to mosqsub|2122-odroid
1554324220: Received PINGREQ from esp8266a03625
1554324220: Sending PINGRESP to esp8266a03625
esp8266d341de is the relay
so its connected and mosquitto is getting packets from it, its just not sending packets to it
Richard
OK.
Weāre now 35 posts into this long-winded thread so why are we now seeing new information like this? This is the first time weāre seeing the topic PIG/relay/0
.
1554324212: Received PUBLISH from esp8266d341de (d0, q0, r1, m0, 'PIG/relay/0', ... (1 bytes))
1554324212: Sending PUBLISH to mosqsub|2122-odroid (d0, q0, r0, m0, 'PIG/relay/0', ... (1 bytes))
Whatās that all about?
Finity
no way of getting at the devices as the whole thing is potted
The upgrade function seems to be something built in to the s/w in it
when a packet is published by HA it get published by mosquitto to mosqsub
when a packet is published by the relay ( PIG) mosquitto publishes to mosqsub
Its like it decided to use a DMZ or something similar.
Iā'l down load MQTT explorer and see if anything shows up, hope it runs in linux , its a MS free zone here
Richard
Once you get MQTT Explorer running connect to your broker and subscribe to all topics (#). Then we can go on from there.
Youāre running it on an Odroidā¦as user odroidā¦so
IS your Home Assistant server
I have been following along trying to figure out a lot of thingsā¦
dont think so as this is the homeassistant server
1554325261: Received PUBLISH from home-assistant (d0, q0, r0, m0, 'PIG/relay/0', ... (1 bytes))
You literally just showed you running a command prompt ON an ODROID as the ODROID userā¦that you are running home assistant on.