Re: [mh] Support for TP-Link Kasa Smart devices

H Plato <[email protected]>
Newsgroups gmane.comp.misc.misterhouse.user
Message-ID <[email protected]>
Could these methods be embedded into the object rather than the items.mht file? For example, in the razberry module, different object types have some slightly different parameters. All of those calls are in the module, so all the end user needs to do in the items.mht file is specity the type, ie RAZBERRY_DIMMER , RAZBERRY_BLIND , RAZBERRY_LOCK etc…

On another note, it’s great to see the recent activity! My S31 power sensing sonoff is on it’s way so I’m looking forward to trying this out and contributing!

> On Dec 17, 2020, at 4:58 AM, Giles Godart-Brown <[email protected]> wrote:
> 
> Nice work Jeff
> 
> I was wondering if we could genericise this a little and make it easier to add more HTML devices.
> 
> How about we make the device type HTML_ON_OFF_DEVICE instead of KASA and make the  type drive how to turn devices on/off. 
> 
> We may also want to shift the groups parameter around to accommodate more parameters for other devices in the future
> 
> For example items.mht would look like this
> 
> # HTML_ON_OFF_DEVICE, ip_address, name,  grouplist,  type, child_id
> HTML_ON_OFF_DEVICE,   192.168.x.y,   Living_Room_KP_0,      Living_Room,    kasa_ strip,  0    
> HTML_ON_OFF_DEVICE,   192.168.x.z,   Kitchen_KP_0,               Kitchen,              tasmota_ relay 
> 
> Then could we be clever in the .pm file and call a routine based on type?  
> 
> At the moment I have a little config file e.g.
> 
> # Device_type,on_command,Off_command
> tasmota_relay, cm?cmnd=Power On, cm?cmnd=Power Off
> 
> Since I only have Tasmota devices I've never been able to check if this is sufficiently flexible for others, if not then we may need a bunch of subroutines, one for each device type. I was wondering if we could do something like;
> 
> # Device_type,ON_command,OFF_command
> tasmota_switch, GET|cm?cmnd=Power On,  GET|cm?cmnd=Power Off
> kasa_strip,SYSTEM|/usr/local/bin/kasa...on...,  SYSTEM|/usr/local/bin/kasa...off..., 
> 
> However as I wrote it I realised this is a big security hole, so the bunch of subroutines is probably a better route.
> 
> Thoughts?
> 
> Giles
> 
> 
> On 16/12/2020 21:21, Jeff Siddall via misterhouse-users wrote:
>> Update:  This is now in a pull request.  You can have a look here if you want to test it out now: 
>> 
>> https://github.com/hollie/misterhouse/pull/802/commits/aa2fd64d24bfdb22e25f50020d72bba0cfa8ebd6 <https://github.com/hollie/misterhouse/pull/802/commits/aa2fd64d24bfdb22e25f50020d72bba0cfa8ebd6> 
>> 
>> 
>> 
>> ________________________________________________________ 
>> To unsubscribe from this list, go to: https://lists.sourceforge.net/lists/listinfo/misterhouse-users <https://lists.sourceforge.net/lists/listinfo/misterhouse-users> 
>> 
> ________________________________________________________
> 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.