Skip to content

Conversation

p-hagen
Copy link
Contributor

@p-hagen p-hagen commented Aug 30, 2020

Making sure the Anna Preset selector switch now notifies the Event system, allowing Events to react to these changes as well
using m_mainworker.PushAndWaitRxMessage.
Fixed general event handling
Added Logs line to better trace what happens
Added Usage log line to help new user with the Preset handling

  • tabs vs spaces etc

@gizmocuz
Copy link
Contributor

@p-hagen , thank you for this PR and your work.
Question, instead of using PushAndWaitRxMessage and querying the database, why not use the function

SendSwitch(const int NodeID, const uint8_t ChildID, const int BatteryLevel, const bool bOn, const double Level, const std::string& defaultname, const int RssiLevel /* =12 */)

@p-hagen
Copy link
Contributor Author

p-hagen commented Aug 31, 2020

@gizmocuz, I have followed examples of coding for an selector switch in Domoticz code (onkyo, Daikin,PhilipsHue as fe examples)

As far as i could tell they all followed the PushAndWaitRxMessage then query the database.
Initially to update the switch with the correct options string as it gets created by the PushAndWaitRxMessage , then secondly to update SValue if the switch changed.

I know in the past i tried to work with SendSwitch when i first implemented the preset selector switch , but the only way i managed to get the selector switch to work reliable was with updating the Database.

If you can point me to a working example of an selector switch using SendSwitch, I will happily change the code.

For all other switches i've added in the past, I use the regular helper functions as they are super easy

@gizmocuz
Copy link
Contributor

@p-hagen , Sorry about this, totally missed the 'sector switch' .... thought it was a normal switch ;)
Maybe in the feature we should make a helper function for this switch as well ;)

@gizmocuz gizmocuz merged commit cca10cd into domoticz:development Aug 31, 2020
@gizmocuz
Copy link
Contributor

Thanks!!

@p-hagen
Copy link
Contributor Author

p-hagen commented Aug 31, 2020

No problem...! Thanks for validating I still haven't lost my code stealing..ehhh.. borrowing skills ;)
a helper function switch would indeed be handy making is easier for adding them to ccp plugins..

@awalsum
Copy link

awalsum commented Sep 5, 2021

Could any of this also have changed the function of "flame_state"? What I see happening now is that flame_state is switched on as soon as the heat pump is started, while in the anna.plugwise.net portal you see that the boiler is off. If I'm correct, flame_state used to be the command to also start the boiler (should the Elga not be capable of heating on its own).

If flame_state is now used to signal if the Elga heat pump is operational, is it possible to also signal if the boiler is required?
I had a look through the code (for as much as I can decipher it) and see that there is also a parameter called "boiler_state". I don't however see this created as a device when I add the Anna as new hardware. Modulation level of the heat pump would also be useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants