I am using v3.8740
When using S_DIMMER I get a device with Type=Light/Switch and Subtype=AC. I add it to see I can see it under Switches.
Under Switch I edit the device to be a Dimmer(Switch Type)
I can change it and my Node can request the device number. I request for V_PERCENTAGE. In my Node I get a value between 0-660. I was excepting a value between 0-100, since it is percentage. Sometimes a get a value between 0-100 but most of the times I get between 0-660.
S_DIMMER sending wrong value?
Moderator: leecollings
-
- Posts: 7
- Joined: Wednesday 07 September 2016 2:58
- Target OS: Linux
- Domoticz version: Beta
- Location: A Swede in Santiago
- Contact:
Re: S_DIMMER sending wrong value?
I'm bumping this since I am suffering from exactly the same problem. I'm currently on version 3.8796.
Cheers !
Cheers !
____________________________________________
domoticz hooked up with :
Philips Hue (v2 Hub + 14 lamps)
MySensors (~15 nodes)
Roborock S5 Max
Broadlink RM2
Chromecast Audio & Video
domoticz hooked up with :
Philips Hue (v2 Hub + 14 lamps)
MySensors (~15 nodes)
Roborock S5 Max
Broadlink RM2
Chromecast Audio & Video
-
- Posts: 279
- Joined: Sunday 03 January 2016 14:55
- Target OS: -
- Domoticz version:
- Location: Sweden
- Contact:
Re: S_DIMMER sending wrong value?
I am also getting a value between 0-660 when asking for percentage
-
- Posts: 7
- Joined: Wednesday 07 September 2016 2:58
- Target OS: Linux
- Domoticz version: Beta
- Location: A Swede in Santiago
- Contact:
Re: S_DIMMER sending wrong value?
Hi !
I think I found out what's wrong in MySensorsBase.cpp :
In the last lines in MySensorsBase::GetSwitchValue(const int Idx, const int SubUnit, const int sub_type, std::string &sSwitchValue) :
should be :
Because the dimmer value ("slevel") is stored as 0-100 in the database.
And while I was at it, I also found in MySensorsBase::WriteToHardware(const char *pdata, const unsigned char length) that I assume is an error too (?) :
that should be
Now, I don't know how to submit these changes myself yet, so if someone else can do this pleae, or shall I take some time to make it myself ? 
Cheers !
/T
I think I found out what's wrong in MySensorsBase.cpp :
In the last lines in MySensorsBase::GetSwitchValue(const int Idx, const int SubUnit, const int sub_type, std::string &sSwitchValue) :
Code: Select all
sstr << int(slevel * 100 / 15);
Code: Select all
sstr << int(slevel);
And while I was at it, I also found in MySensorsBase::WriteToHardware(const char *pdata, const unsigned char length) that I assume is an error too (?) :
Code: Select all
float fvalue = (100.0f / 14.0f)*float(pCmd->LIGHTING2.level);
Code: Select all
float fvalue = (100.0f / 15.0f)*float(pCmd->LIGHTING2.level);

Cheers !
/T
____________________________________________
domoticz hooked up with :
Philips Hue (v2 Hub + 14 lamps)
MySensors (~15 nodes)
Roborock S5 Max
Broadlink RM2
Chromecast Audio & Video
domoticz hooked up with :
Philips Hue (v2 Hub + 14 lamps)
MySensors (~15 nodes)
Roborock S5 Max
Broadlink RM2
Chromecast Audio & Video
-
- Posts: 7
- Joined: Wednesday 07 September 2016 2:58
- Target OS: Linux
- Domoticz version: Beta
- Location: A Swede in Santiago
- Contact:
Re: S_DIMMER sending wrong value?
Edit:
Looks like I managet to push my changes do the development branch in github now
Just waitng for it to be available some day now.
/T
Kind of giving up now since I can't push my updates back to github
Is there some kind soul who can include the two bugfixes I list in the post above, plus add the handling I_INCLUSION_MODE message in the first case-statement in MySensorsBase::ParseLine() ?
Cheers & TIA !
/T
Looks like I managet to push my changes do the development branch in github now

/T
Kind of giving up now since I can't push my updates back to github

Is there some kind soul who can include the two bugfixes I list in the post above, plus add the handling I_INCLUSION_MODE message in the first case-statement in MySensorsBase::ParseLine() ?
Code: Select all
case I_INCLUSION_MODE:
_log.Log(LOG_NORM, "MySensors: Inclusion mode=%s", payload.c_str());
m_sql.m_bAcceptNewHardware = atoi(payload.c_str()) ? true : false;
break;
/T
____________________________________________
domoticz hooked up with :
Philips Hue (v2 Hub + 14 lamps)
MySensors (~15 nodes)
Roborock S5 Max
Broadlink RM2
Chromecast Audio & Video
domoticz hooked up with :
Philips Hue (v2 Hub + 14 lamps)
MySensors (~15 nodes)
Roborock S5 Max
Broadlink RM2
Chromecast Audio & Video
Who is online
Users browsing this forum: No registered users and 1 guest