Device created in plugging, use in blocky

Python and python framework

Moderator: leecollings

Post Reply
St7ven
Posts: 22
Joined: Friday 10 March 2017 9:27
Target OS: Windows
Domoticz version:
Contact:

Device created in plugging, use in blocky

Post by St7ven »

Hi,

Within blocky, I'm trying to use a device that has been created with a python plugin :

Code: Select all

Domoticz.Device(Name="Plugin_Blind", Unit=2, TypeName="Switch", DeviceID="07070707",  Switchtype=3).Create()
The device appear in blocky but the statement are not executed correctly (if plugin_devince = Closed). Nevertheless, the current states display the good state of this device.

It seems as only the OnCommand() function of the pluggin is called?

By the way, this device does not change icon state either on the switch tab.

I have noticed a difference between a dummy blind switch and the plugin device blind switch :

[img]Debug_Blind_switch.jpg[/img]

I was looking for the list of TypeName and SwitchType. TypeName are clearly mentionned here https://www.domoticz.com/wiki/Developin ... hon_plugin. Is it up to date ? Where could I find the switchtype number list ?

Thank you for your help
Attachments
Debug_Blind_switch.jpg
Debug_Blind_switch.jpg (191.9 KiB) Viewed 1206 times
User avatar
Dnpwwo
Posts: 820
Joined: Sunday 23 March 2014 9:00
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Melbourne, Australia
Contact:

Re: Device created in plugging, use in blocky

Post by Dnpwwo »

@St7ven,

The TypeName parameter really just mimics what is available in the Dummy hardware type for consistency. If you want to copy a device type that you already have that works I would recommend using the Type, SubType & SwitchType parameters instead, you get get much better control over what is created.

You can look in the Domoticz database's DeviceStatus table using somethink like sqlite3 browser to pick up the values of existing devices.
The reasonable man adapts himself to the world; the unreasonable one persists to adapt the world to himself. Therefore all progress depends on the unreasonable man. George Bernard Shaw
St7ven
Posts: 22
Joined: Friday 10 March 2017 9:27
Target OS: Windows
Domoticz version:
Contact:

Re: Device created in plugging, use in blocky

Post by St7ven »

@Dnpwwo

Very usefull tool. Thank you for the tips ! Devices are working fine now. I forgot to update Devices[x].update(values...)

Is is possible to create scene (group) from a python plugin ?
User avatar
Dnpwwo
Posts: 820
Joined: Sunday 23 March 2014 9:00
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Melbourne, Australia
Contact:

Re: Device created in plugging, use in blocky

Post by Dnpwwo »

@St7ven,

You can't create scenes or groups in the current version. Maybe in the future.
The reasonable man adapts himself to the world; the unreasonable one persists to adapt the world to himself. Therefore all progress depends on the unreasonable man. George Bernard Shaw
St7ven
Posts: 22
Joined: Friday 10 March 2017 9:27
Target OS: Windows
Domoticz version:
Contact:

Re: Device created in plugging, use in blocky

Post by St7ven »

Thank you for you support Dnpwwo. Really appreciate it.
Terry321
Posts: 1
Joined: Friday 02 June 2017 13:10
Target OS: Windows
Domoticz version:
Contact:

Re: Device created in plugging, use in blocky

Post by Terry321 »

since The systems like Netflix charge us a lot. You TV Player makes You TV Player APK Download type of site for downloading the APK data.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest