Moderators: grovkillen, Stuntteam, TD-er
-
tribal
- Normal user
- Posts: 10
- Joined: 23 Dec 2017, 09:47
#1
Post
by tribal » 20 Feb 2018, 15:08
Hi to all!
Can you explaine me how to set values for Dummy Switch with mqtt command?
I have this config on my esp:
Снимок1.JPG
Снимок.JPG
This command:
Code: Select all
mosquitto_pub -h xxx.xxx.xxx.xxx -t "sonoff_esp/Boot_State/OnBoot_On" -m 1
don't do anything for esp dummy switch (
You do not have the required permissions to view the files attached to this post.
-
grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
#2
Post
by grovkillen » 20 Feb 2018, 15:59
You need to use this topic:
And this payload:
Edit: if TaskValueSet isn't accessible through mqtt then you'll need to create an event.
Please refer to the wiki.
-
tribal
- Normal user
- Posts: 10
- Joined: 23 Dec 2017, 09:47
#3
Post
by tribal » 21 Feb 2018, 18:44
Thanks.
Now all works with http request. With mqtt no lucky.
-
grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
#4
Post
by grovkillen » 21 Feb 2018, 19:07
Now that's not good. What's your setup for MQTT?
-
tribal
- Normal user
- Posts: 10
- Joined: 23 Dec 2017, 09:47
#5
Post
by tribal » 21 Feb 2018, 19:24
MQTT setup in ESP or in MQTT broker server?
PS dummy switches don't save values after reboot.. all switches have "0". That's not what I respect

I try to make an external control for boot state of relay after reboot. Maybe I do something wrong?

-
grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
#6
Post
by grovkillen » 21 Feb 2018, 19:50
Controller setup in esp.
Regarding losing values on reboot, every device does this. We would need to add support for a EEPROM module or other backup memory.
-
tribal
- Normal user
- Posts: 10
- Joined: 23 Dec 2017, 09:47
#7
Post
by tribal » 21 Feb 2018, 20:21
This is my setup:
Снимок.JPG
In advanced settings:
MQTT Retain Msg: on
Message Delay: 1000 [ms]
If all states are lost, how to save values for preferred boot state?
The modules has many free space, why it don't save any values on it? This not logical and uncomfortable.
You do not have the required permissions to view the files attached to this post.
-
vader
- Normal user
- Posts: 241
- Joined: 21 Mar 2017, 17:35
#8
Post
by vader » 21 Feb 2018, 20:27
Due to a limited life time of the flash chips, we reduce all write cycles to a minimum.
-
grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
#9
Post
by grovkillen » 21 Feb 2018, 21:02
Yes that is the reason for not using the main flash for storing values. It's completely logical and how it should work.
Until we have support for external EEPROM (not sure if we will add it), you can use retained messages since the broker will always store these and then they'll be re-imported on boot.
Or you could make a rule that set the trask values on system#boot
-
tribal
- Normal user
- Posts: 10
- Joined: 23 Dec 2017, 09:47
#10
Post
by tribal » 21 Feb 2018, 21:33
you can use retained messages since the broker will always store these and then they'll be re-imported on boot.
how can I do it?
for now it don't get retained messages. Maybe it depends from espeasy software?
in mosquito I activate retained messages.
-
grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
#11
Post
by grovkillen » 21 Feb 2018, 21:35
Under the advance page. If you study the wiki you will find info like this.
-
tribal
- Normal user
- Posts: 10
- Joined: 23 Dec 2017, 09:47
#12
Post
by tribal » 21 Feb 2018, 21:54
In advanced settings:
MQTT Retain Msg: on
Message Delay: 1000 [ms]
I do it when flash the device. But nothing changed. If it will works for me, I don't ask how to do this!

-
grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
#13
Post
by grovkillen » 21 Feb 2018, 22:06
So then you need to make sure that the dummy is reporting to the broker. Once every minute or so? Then you need mqtt import to get them back from the broker. But if this is over you knowledge I will make a guide for others to follow, don't have the time right now but soon.
-
tribal
- Normal user
- Posts: 10
- Joined: 23 Dec 2017, 09:47
#14
Post
by tribal » 21 Feb 2018, 22:35
I understand the logic, but I don't understand why it doesn't work in my case!
Maybe it's because I have GIT version: mega-20180104 ?
grovkillen wrote: ↑21 Feb 2018, 22:06
I will make a guide for others to follow, don't have the time right now but soon.
It will be greate. Don't rush you, It's not urgently.
Upd. the retain for gpio pins now working (in openhab config was disabled retain policy)
But I still can't change the values of dummy switch with mqtt!

Who is online
Users browsing this forum: Anthropic Claude Bot [bot], opensiteexplorer.org/dotbot [bot] and 15 guests