Extended Python Framework Options parameter

Python and python framework

Moderator: leecollings

Post Reply
pipiche
Posts: 2016
Joined: Monday 02 April 2018 20:33
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: France
Contact:

Extended Python Framework Options parameter

Post by pipiche »

In the Domoticz Python Framework, the Options parameters is documented as Read/Write, however when

Doing

Code: Select all

Devices[DeviceID_].Units[Unit_].Options = Options
This trigger an exception
AttributeError: readonly attribute

For exemple when using a Electricity (instant and counter), if we detect that the Energy is provided by the hardware, we want to set options with

Code: Select all

{'EnergyMeterMode': '1'} 
Zigbee for Domoticz plugin / RPI3B+ / Electrolama ZZH-P / 45 devices

If the plugin provides you value, you can support me with a donation Paypal.

Wiki is available here.

Zigbee for Domoticz FAQ
JanJaap
Posts: 215
Joined: Thursday 12 October 2017 20:46
Target OS: Raspberry Pi / ODroid
Domoticz version: Dev
Location: the Netherlands
Contact:

Re: Extended Python Framework Options parameter

Post by JanJaap »

You would normally provide the options during the creation of the unit. Does that not work for you or do you need to modify it after creation?

The documentation indeed suggests you can update it after creation, so either documentation or implementation would need updating ;)
RPi 3, Domoticz dev version, Aeon ZWave stick (with a whole bunch of slaves), Zigbee using Zigbee2MQTT, Nest thermo, P1 smart meter on RPi Zero
User avatar
waltervl
Posts: 5853
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Extended Python Framework Options parameter

Post by waltervl »

Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
pipiche
Posts: 2016
Joined: Monday 02 April 2018 20:33
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: France
Contact:

Re: Extended Python Framework Options parameter

Post by pipiche »

JanJaap wrote: Wednesday 20 December 2023 19:20 You would normally provide the options during the creation of the unit. Does that not work for you or do you need to modify it after creation?

The documentation indeed suggests you can update it after creation, so either documentation or implementation would need updating ;)
Yes and no, because in Zigbee the plugin that we have discover the Device functionality. And during the discovery, the device can expose the Metering functionality, however it is only after a short while that we will get or not the summation .

This is why we create the Device at the discovery time set by default 'Computer' and as soon as we receive a summation we update the Options
Zigbee for Domoticz plugin / RPI3B+ / Electrolama ZZH-P / 45 devices

If the plugin provides you value, you can support me with a donation Paypal.

Wiki is available here.

Zigbee for Domoticz FAQ
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest