[mythtv-users] Leanfront and events

Jim Abernathy jfabernathy at gmail.com
Wed Nov 17 12:03:43 UTC 2021


On 11/16/21 9:34 PM, Stephen Worthington wrote:
> On Tue, 16 Nov 2021 20:12:25 -0500, you wrote:
>
>> On 11/16/21 7:20 PM, mythtv wrote:
>>> For Leanfront, yea, something that could maybe do a POST to a
>>> webserver would be useful.  Maybe do a post to a URL and the payload
>>> could contain the info about what is playing, or paused, etc.
>>
>> I did some quick tests and it is easy to use netcat to listen on an
>> address and capture what came back in a shell script. So leanfront could
>> invoke a URL for each event and you could receive it in a web server or
>> a shell script, your choice, and do whatever you need with it.
>>
>> If this is something you would like, please open a ticket in github
>> (https://github.com/bennettpeter/android-MythTV-Leanfront/issues) and
>> include a list of the events you would like. I will set up a settings
>> page where you can specify that you want events and where to send them.
>> The event url should also include some indication of which leanfront is
>> sending the event, so that if you have two fire sticks running leanfront
>> the events do not get confused.
>>
>> I may not get to it right away but I will do so at some point.
>>
>> Peter
> The normal tool used for monitoring for incoming messages with home
> automation is MQTT, if you do not have direct support for the device
> in your home automation software:
>
> https://en.wikipedia.org/wiki/MQTT
> https://mqtt.org
>
> So if you are adding a protocol to Leanfront, that would be a good one
> to choose as it is very well supported and works well.
>
> Home Assistant does already have an integration for TP-Link Kasa
> devices:
>
> https://www.home-assistant.io/integrations/tplink
>
> so I would think that other home automation software (eg OpenHab)
> would likely have support too.  When one open source HA software adds
> support, the others usually follow soon after as the hard work of
> finding out how to do it has been done

I would vote for MQTT as the protocol for this, as I've used that all 
over my house for passing temperature and humidity measurements to a 
central database (influxDB) to track all that. The code for MQTT is 
available in python, c++, circuitpython, ardunio, etc. The Leanfront 
code would just need a setting for each event like "topic" to subscribe 
to, etc.  I'm not using HomeAssistant, as I did my own stuff with NodRed 
which centralized the data between MQTT, influxdb, grafana, and 
clients/endpoints.

Jim A




More information about the mythtv-users mailing list