Re: [mh] Adding Tasmota HTTP support

Jeff Siddall via misterhouse-users <[email protected]>
Newsgroups gmane.comp.misc.misterhouse.user
Message-ID <[email protected]>
Update: some Sonoff Minis showed up this afternoon.  It was a bit fiddly 
to get them updated to Tasmota, but I have that done now. More 
surprisingly, I also successfully controlled them from my new perl 
module on the first attempt.  I don't remember the last time I wrote 
something that worked on the first try!

Unfortunately I have had less luck getting Tasmota to send local control 
messages back to MH.  It always reports a timeout when sending the HTTP 
request, even though I can successfully send the exact same URL from my 
phone on the same WiFi network.  If I take out the port number from the 
URL then the Tasmota device does successfully send the request [to port 
80], but I have an apache server running on port 80 on my MH machine so 
that doesn't exactly work.  I hope I haven't found a bug in the firmware.

I will do some more troubleshooting to see if I can get to the bottom of it.

Jeff

On 2020-12-13 12:45 a.m., Jeff Siddall wrote:
> Thanks!
>
> I decided to take a stab at it, and after a couple of hours have 
> Tasmota_HTTP_Item.pm written.  This one is a more substantial 30 lines 
> of code, plus another 5 lines in read_table_A.pl.
>
> Now I just need some devices to test it with.
>
> Jeff
>
> On 2020-12-12 9:55 p.m., H Plato wrote:
>> Look at my razberry module. This is very similar to how it works. 
>> Sending a http command for control and having a web endpoint for 
>> accepting status changes.
>>
>> Sent from my mobile device.
>>
>>> On Dec 12, 2020, at 7:41 PM, Jeff Siddall via misterhouse-users 
>>> <[email protected]> wrote:
>>>
>>> As a follow-on to the "What’s better than Insteon?" thread, Giles 
>>> put me onto the Tasmota open source firmware that will run on a huge 
>>> number (literally thousands) of smart things on the market. While 
>>> you can talk to those over MQTT, then you also need to setup a 
>>> broker, and that seems awkward in a world where all the smart things 
>>> have web interfaces.
>>>
>>> So that got me thinking about building a "Tasmota_HTTP_Item" in MH.  
>>> There is already support for SETting things in MH using HTTP via the 
>>> lib/http_server.pl code.  Tasmota devices can send updates using 
>>> HTTP, as in this example:
>>>
>>> https://tasmota.github.io/docs/Rules/#two-way-light-switches-without-mqtt 
>>>
>>>
>>> So combining those two would result in a rule for local switch 
>>> control on the Tasmota with a command like:
>>>
>>> WebSend [<mh_ip_address>:8081] 
>>> /SET;none?select_item=Tasmota_Item_Name&select_state=on
>>>
>>> And for remote control, MH would send a command like this when an 
>>> item is set:
>>>
>>> get 'http://<tasmota_item_ip>/cm?cmnd=POWER1 ON'
>>>
>>> The only other thing is that the "set" function for the Tasmota_Item 
>>> would need to check if the item was set_by:
>>>
>>> web [<tasmota_item_ip_address>]
>>>
>>> ...and then not send anything in that case so it doesn't end up in a 
>>> send loop with the Tasmota device.
>>>
>>> Anyone tried anything like that?  If not, I guess it is time to 
>>> order some of these things and start tinkering!
>>>
>>>
>>>
>>> ________________________________________________________
>>> To unsubscribe from this list, go to: 
>>> https://lists.sourceforge.net/lists/listinfo/misterhouse-users
>>>


________________________________________________________
To unsubscribe from this list, go to: https://lists.sourceforge.net/lists/listinfo/misterhouse-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.