bsileo / hubitat_poolcontroller

Integration from a SmartThings or Hubitat hub to nodejs_poolcontroller
MIT License
8 stars 5 forks source link

Temperatures need a scale #15

Closed bkhall closed 3 years ago

bkhall commented 3 years ago

Successfully linked up the poolController library to Hubitat with this package - nice work.

Was able to get most things to show up in Google Home.

The ones that I could not get to work correctly were anything regarding temperatures. AirTemps, Water temps and setpoints - none of it would link to Google. I suspect this is because no scale is provided with the reading for Hubitat to pass to Google to know what to show.

Spa Body: image

Pool Body: image

AirTemp: image

Solar Temp: image

bsileo commented 3 years ago

Interesting issue - these are setup as a "Generic Component Temperature Sensor" as provided by Hubitat. Looking into that, I believe I can add a Unit specification to them and this may clear things up. I didn't realize the system was not accepting these values and assuming it was a temperature in the system units ( Fahrenheit ).

bsileo commented 3 years ago

What do you see when you look at events for Air Temp? I rechecked some code for that and the units are in fact there:

image

bkhall commented 3 years ago

Well, you're right about the logs. They do show units.

Google Home kicks it out as an invalid sensor though. I just assumed that because no units are shown on the Current State section on the Hubitat sensor view, that Hubitat might not be sending a scale with the number to Google. But I have no ways of confirming that.

image

I'm also not sure where these logged units are coming from. Are they sourced from a setting in Hubitat, or are they being pulled in with the number from the poolController library?

bsileo commented 3 years ago

I am not surprised that ones like SetPoint don't work - since they are not "TemperatureMeasurement" capabilities just generic attributes. But AirTemp and SolarTemp are using off the shelf Hubitat code for the devices so I really can't do anything to even change the behavior on those.

I am going to look into options to add units to the SetPoints and similar ones. Perhaps you can investigate the interface to Google and see if you can learn anything there. For example, do other temperature devices work with Google? When I get a chance I will try adding these to my Google Home setup here as well.

bkhall commented 3 years ago

It's also interesting that the poolController-webClient is not showing a scale - on any temperature - air temp, water temp, and setpoints.

image

It looks to me like the poolController library is just sending you a number, with no scale. So I'm not sure where the scale shown in the logs is coming from.

bsileo commented 3 years ago

That being added by me in the driver code.

bkhall commented 3 years ago

Ah ok...how do you know it's F vs. C?

If I change the option to C in ScreenLogic, this happens:

image

They're not F anymore...

bsileo commented 3 years ago

I just pushed a fix to include the unit on SetPoint. The driver does not currently get the value from the PoolController - it is just using the locale setting in Hubitat.

bkhall commented 3 years ago

I see. I'll go talk to the poolController dev and see if the units can be sent over.

bsileo commented 3 years ago

I suspect they can - I think I have talked with them on this before. I just haven't implemented it at this point. You can open an issue here and I will take a look at some point.

bkhall commented 3 years ago

It looks like there is a temperature units parameter in the top level object (system board). For you, that would be likely be in the data you ingest for the pool_controller.groovy driver. Generally, that would be sufficient, but there are other states, and equipment that might have their own scales. So, you may need to look at other drivers that might be different from the main board - pool_controller_chlorinator, pool_controller_heater, pool_controller_intellichem

tagyoureit commented 3 years ago

We do store the temp units and they can be retrieved via http://server:4200/state/temps or http://server:4200/state/all (under temps).

@bsileo Can you retrieve this when you setup the equipment? It isn't currently included with the body temp emits.

bkhall commented 3 years ago

The latest update fixed the way temp units were being retrieved and used.

bsileo commented 3 years ago

We do store the temp units and they can be retrieved via http://server:4200/state/temps or http://server:4200/state/all (under temps).

@bsileo Can you retrieve this when you setup the equipment? It isn't currently included with the body temp emits.

Yes I am pulling units from /state/temps now and using this for all events in Hubitat.