jvmahon / Homebridge-HomeSeer4

Homebridge Plugin for HomeSeer 3 and 4
28 stars 8 forks source link

Decimal (,5) in Thermostat #133

Closed mbaastrup closed 3 years ago

mbaastrup commented 3 years ago

I have a thermostat running in test, its working as such. It ref'ed to different devices in a parent-child device structure in HS4. When I change the temp from the HomeKit GUI to a whole number (e.g. 23) it set the temp, log entry in both Homebridge and HS4 is good. When I change the temp from the HomeKit GUI to a half degree value (e.g. 23,5) the log entry in Homebridge show no change When I change the temp directly in HS4 from 23 to 23,5 the value is set in HS so it seems the HS4 device works fine but is is not picked up by Homebridge.

/MB

jvmahon commented 3 years ago

Can you change your number format to use the US-style decimal as the separator -- i.e., use 23.5.

=============== For anybody who wants to help with a fix that works with the comma-separated decimal numbers, here's what I think is happening . . .

There's a code file called "Setup Listerner.js" in the "lib" directory. The main function of this code is to listen for changes coming over the telnet port. HomeSeer generally formats the data as a comma separated string of parameters. A portion of that code (lines 72-83), reporduced, splits the string into individual parameters using the comma (line 74).

            case(thisUpdate.startsWith("DC")): // Handle received data
                {   
                myData = new HSData( thisUpdate.split(","));
                    //Only need to do an update if there is HomeKit data associated with it!, Which occurs if the notifyObjects array is not undefined.
                    if( (HomeSeerData.HomeSeerDevices[myData.ref]) && (HomeSeerData.HomeSeerDevices[myData.ref].notifyObjects !== undefined) )  
                    {
                        globals.log(`HomeSeer device: ${cyan(myData.ref)}: new value ${cyan(myData.newValue)}, had old value ${cyan(myData.oldValue)}` );

                        HomeSeerData.processReceivedData(myData.ref, parseFloat(myData.newValue))
                    } 
                    break;
                };

I never considered non-US numbers, so a number like "23,5" arriving on that port will be split as if it is two parameters.

I'm not really doing much work on this code anymore -- I'll still help and answer questions on github, but I am no longer using HomeSeer so I can't do much to experimenting / testing, but if anybody has a solution that they want to propose and have tested - and can confirm it works both on "." and "," separated decimal numbers - please post as a pull request

mbaastrup commented 3 years ago

Thanks!

I will try that - is it the format on the hombridge (running in a container) or on the HomeSeer server (windows 10) or the iDevice you refer to? I am myself looking for an alternative to HS as the architecture and the completeness of different parts of is not good enough.

Can I ask what you are going for as replacement?

/MB

On 13 Jan 2021, at 16.23, jvmahon notifications@github.com wrote:

Can you change your number format to use the US-style decimal as the separator -- i.e., use 23.5.

=============== For anybody who wants to help with a fix that works with the comma-separated decimal numbers, here's what I think is happening . . .

There's a code file called "Setup Listerner.js" in the "lib" directory. The main function of this code is to listen for changes coming over the telnet port. HomeSeer generally formats the data as a comma separated string of parameters. A portion of that code (lines 72-83), reporduced, splits the string into individual parameters using the comma (line 74).

      case(thisUpdate.startsWith("DC")): // Handle received data
          {   
          myData = new HSData( thisUpdate.split(","));
              //Only need to do an update if there is HomeKit data associated with it!, Which occurs if the notifyObjects array is not undefined.
              if( (HomeSeerData.HomeSeerDevices[myData.ref]) && (HomeSeerData.HomeSeerDevices[myData.ref].notifyObjects !== undefined) )  
              {
                  globals.log(`HomeSeer device: ${cyan(myData.ref)}: new value ${cyan(myData.newValue)}, had old value ${cyan(myData.oldValue)}` );

                  HomeSeerData.processReceivedData(myData.ref, parseFloat(myData.newValue))
              } 
              break;
          };

I never considered non-US numbers, so a number like "23,5" arriving on that port will be split as if it is two parameters.

I'm not really doing much work on this code anymore -- I'll still help and answer questions on github, but I am no longer using HomeSeer so I can't do much to experimenting / testing, but if anybody has a solution that they want to propose and have tested - and can confirm it works both on "." and "," separated decimal numbers - please post as a pull request

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jvmahon/Homebridge-HomeSeer4/issues/133#issuecomment-759519210, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKGIIJVFXYVJNKSVQCQLLJTSZW3FTANCNFSM4V3N5AWA.

jvmahon commented 3 years ago

You need to change the format used by HomeSeer so that HomeSeer sends the correct message. I'm currently using Hubitat. I like the rule engine better and its Zigbee support (and I've also ported my HomeKit code to that platform).

mbaastrup commented 3 years ago

Thanks - I changed the servers decimal code and it seems to work - more thorough testing during the next hours to see if some else break, but so far so good.

I will look at Habitat as it is especially the rules engine that is poor. I use EasyTrigger for almost everything, it should be needed and just be plain native in HS.

/MB

On 13 Jan 2021, at 18.35, jvmahon notifications@github.com wrote:

You need to change the format used by HomeSeer so that HomeSeer sends the correct message. I'm currently using Hubitat. I like the rule engine better and its Zigbee support (and I've also ported my HomeKit code to that platform).

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jvmahon/Homebridge-HomeSeer4/issues/133#issuecomment-759605250, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKGIIJVXF4CPETKZR7EOBOLSZXKVLANCNFSM4V3N5AWA.

jvmahon commented 3 years ago

I use EasyTrigger for almost everything,

I was a big fan of EasyTrigger. Its a shame that HS4 didn't incorporate some of that functionality - in my mind, that would have been a much greater improvement that the changes they did decide on.

Remind me - since I'm no longer using HomeSeer - where do you make the change from "," to "." in the decimal numbers and I'll add a note to the wiki.

mbaastrup commented 3 years ago

Completely agree - HS4 is primarily a boilerplate UI upgrade and not a very succesfull one

I changed it on the OS actually, Regional setting in Control panel - there is a list of formats and decimal is one of them. I couldn’t find anything in the application level so I did it on OS

On 14 Jan 2021, at 19.19, jvmahon notifications@github.com wrote:

I use EasyTrigger for almost everything,

I was a big fan of EasyTrigger. Its a shame that HS4 didn't incorporate some of that functionality - in my mind, that would have been a much greater improvement that the changes they did decide on.

Remind me - since I'm no longer using HomeSeer - where do you make the change from "," to "." in the decimal numbers and I'll add a note to the wiki.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jvmahon/Homebridge-HomeSeer4/issues/133#issuecomment-760378637, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKGIIJUTIXILRYSO2ERCAPDSZ4YSZANCNFSM4V3N5AWA.

mbaastrup commented 3 years ago

Hi there,

I have been following your project of porting the HS4 to Hubitat for HomeBridge and also now found a dealer in EU that can deliver a Hubitat to me in Denmark.

It seems impressive, especially the community part and as far as I (non tech guy) can tell, the software architecture seems robust.

In you opinion and experience, should I start my migration to Hubitat? I know there will be no such thing as “The Hub for the future” but it seems critical mass and architecture is in favour here.

/MB

On 13 Jan 2021, at 18.35, jvmahon notifications@github.com wrote:

You need to change the format used by HomeSeer so that HomeSeer sends the correct message. I'm currently using Hubitat. I like the rule engine better and its Zigbee support (and I've also ported my HomeKit code to that platform).

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jvmahon/Homebridge-HomeSeer4/issues/133#issuecomment-759605250, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKGIIJVXF4CPETKZR7EOBOLSZXKVLANCNFSM4V3N5AWA.

jvmahon commented 3 years ago

I quite like Hubitat. I think it has a far better rule engine for writing custom rules. Its interface to plugins like my Homebridge / Homekit plugin is also much better defined and much easier to work with -- it probably took 1/2 the time to implement a HomeKit plugin for Hubitat compared to HomeSeer. It has its rough spots, but it seems to be evolving and improving quickly. I also like the fact that I can use both Zigbee and Z-Wave devices as the hub supports both without requiring any additional hardware or plugins..

Where Hubitat is weaker is for support of non-Zigbee, non-Zwave. As you know, HomeSeer has plugins for just about everything imaginable. Hubitat also has plugins for a range of devices, but they don't seem to be of the same quality. So each platform has its advantages. If you are primarily using Z-wave / Zigbee, I'd say go with Hubitat. If you have a lot of other plugins, maybe not.

If you are getting Hubitat, be sure that your dealer is selling the "latest" one (the one with the series 700 Z-wave chip, its hubitat model C-7).

mbaastrup commented 3 years ago

Thanks - this is highly valuable experience sharing. Its not the expense of the hub the concerns me, but the work to migrate - its a bet you take right.

From a radio signal point of view, I only have 433 mhz next to Zigbee+Zwave - I plan to use my old HS for 433 mhm on a VMWare/RPI handling that as a web service directly to the CAPI controller - its only 4 blinds, identical setup - triggered by web-commands in Hubitat. Besides that I use Sonos (i guess that will work), Zwave, Zigbee and the EasyTrigger (I only use 5% native HS in reality)

There is a plugin in HS to interface with Hubitat - I might want to separate physical infrastructure (HS) from rules, intelligence and interface API to HomeKit) - it might be a complex architecture, but loosely coupled I guess. This is plan B Plan A is completely abandon HS as too much of it is 80% implemented at best.

I have ordered the C7 and planned for a few days vacation…

On 23 Feb 2021, at 13.58, jvmahon notifications@github.com wrote:

I quite like Hubitat. I think it has a far better rule engine for writing custom rules. It has its rough spots, but it seems to be evolving and improving quickly. I like the fact that I can use both Zigbee and Z-Wave devices together.

Where hubitat is weaker is for support of non-Zigbee, non-Zwave. As you know, HomeSeer has plugins for just about everything imaginable. Hubitat also has plugins for a range of devices, but they don't seem to be of the same quality. So each platform has its advantages. If you are primarily using Z-wave / Zigbee, I'd say go with Hubitat. If you have a lot of other plugins, maybe not.

If you are getting Hubitat, be sure that your dealer is selling the "latest" one (the one with the series 700 Z-wave chip, its hubitat model C-7).

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jvmahon/Homebridge-HomeSeer4/issues/133#issuecomment-784182807, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKGIIJRE3KOHR4DUPJAW2KDTAOQ6NANCNFSM4V3N5AWA.

jvmahon commented 3 years ago

My suggestion is to do the "Plan A" and make a complete switch over. I also thought about retaining both, but the work involved in making them work together, and stay working together reliably, to me, it just wasn't worth it. I suggest moving a few devices at a time as you're getting used to Hubitat and writing its rules. There are a number of built-in applications that you may find extremely useful and makes it much easier to implement the intelligence.

mbaastrup commented 3 years ago

I will go with plan A and do a cluster by cluster implementation, on plan B especially keeping them working together is a foreseen challenge - thank you for sharing this. If you have a minute or two at some point, getting to know your Top 5 applications would probably help me - this is my production platform cut over, so getting basics up and running will be a priority.

Thanks - I am looking forward to get working on the C7

/MB

On 23 Feb 2021, at 15.48, jvmahon notifications@github.com wrote:

My suggestion is to do the "Plan A" and make a complete switch over. I also thought about retaining both, but the work involved in making them work together, and stay working together reliably, to me, it just wasn't worth it. I suggest moving a few devices at a time as you're getting used to Hubitat and writing its rules. There are a number of built-in applications that you may find extremely useful and makes it much easier to implement the intelligence.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jvmahon/Homebridge-HomeSeer4/issues/133#issuecomment-784254087, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKGIIJT7BP4ZCHIHMX42VGDTAO52NANCNFSM4V3N5AWA.

jvmahon commented 3 years ago

These are the top built-in apps (think of apps like HomeSeer plugins, but free!):

"Simple Automation Rules" - Easy automations to turn on and off switches.

"Mirror" - if you want a second switch/dimmer to stay in sync with another, use "Mirror". E.g., set dimmer #1 to a certain level, the others "mirror" that setting and get set to the same level.

"Notification" - want to know when your batteries are low or another event happens, use this. Real easy!

"Maker API" - to set up a connect to my homekit plugin homebridge-hubitat https://www.npmjs.com/package/homebridge-hubitat

"Groups and Scenes" - as the name implies, set up lights and other items into groups so you can automate them, or into scenes with pre-set settings

"Mode Manager" - cycles through "modes" like day, night, home, away, etc. You can then use the "modes" in rules.

"Rule Machine" - complex rules when the the above-rules don't cover it. You can do complex if, then, else type programming with Rule Machine. There's a bit of a learning curve, but nothing on HomeSeer is as powerful (except if you do lower-level programming).

"Lock Code Manager" - if you have several locks, use this to keep lock codes in sync

Switch and Dimmer drivers - there are plenty of built-in ones, but I think the ones I've written myself are some of the most powerful ones. See https://github.com/jvmahon/HubitatCustom

mbaastrup commented 3 years ago

Thanks - this is extremely helpfull to get started and get it all running, basics at first. Using you HomeKit is eventually the goal - and besides being very thankful for your support, I have donated to the operations of the local foodbank (this is pretty huge and well organized in Denmark). I really like this way of thinking, and do quite some work with the homeless and soup kitchens around here myself.

Playing around with a plan B Alternate, being adding the Hubitat as Second Controller in my Zwave network as a start - and/or eventually send over the full network from my current wave dongle.

Last thing on my prep list is to figure out a way to either get real 433.92MHz support via Sonof or RFXCom, or be able to send a http command like “http:///blindcontrol?blind=x&pos=y - then I can make a temporary web service in HS to handle them.

On 23 Feb 2021, at 21.44, jvmahon notifications@github.com wrote:

These are the top built-in apps (think of apps like HomeSeer plugins, but free!):

"Simple Automation Rules" - Easy automations to turn on and off switches.

"Mirror" - if you want a second switch/dimmer to stay in sync with another, use "Mirror". E.g., set dimmer #1 https://github.com/jvmahon/Homebridge-HomeSeer4/pull/1 to a certain level, the others "mirror" that setting and get set to the same level.

"Notification" - want to know when your batteries are low or another event happens, use this. Real easy!

"Maker API" - to set up a connect to my homekit plugin homebridge-hubitat https://www.npmjs.com/package/homebridge-hubitat https://www.npmjs.com/package/homebridge-hubitat "Groups and Scenes" - as the name implies, set up lights and other items into groups so you can automate them, or into scenes with pre-set settings

"Mode Manager" - cycles through "modes" like day, night, home, away, etc. You can then use the "modes" in rules.

"Rule Machine" - complex rules when the the above-rules don't cover it. You can do complex if, then, else type programming with Rule Machine. There's a bit of a learning curve, but nothing on HomeSeer is as powerful (except if you do lower-level programming).

"Lock Code Manager" - if you have several locks, use this to keep lock codes in sync

Switch and Dimmer drivers - there are plenty of built-in ones, but I think the ones I've written myself are some of the most powerful ones. See https://github.com/jvmahon/HubitatCustom https://github.com/jvmahon/HubitatCustom — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jvmahon/Homebridge-HomeSeer4/issues/133#issuecomment-784498504, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKGIIJQ4WC2G7VKUJPDA53LTAQHRLANCNFSM4V3N5AWA.

jvmahon commented 3 years ago

I'm closing out this issue since I think there is nothing else to be done on the Thermostat feature. If you have any more questions on Hubitat or my Hubitat plugin, please contact me through the issues reporting for that plugin. Good luck!