njanik / hayward-pool-heater-mqtt

A sketch to control an Hayward pool heater via MQTT
MIT License
17 stars 9 forks source link

Celcius to Fahrenheit #19

Open mjackmtl opened 3 months ago

mjackmtl commented 3 months ago

Hi,

I got this working in HA, thank you!, Just wondering if the temperature could be set into Fahrenheit?

I've tried changing the code but I would assume the data is set to receive in celsius only, would there be any easy way to change it?

image

Mike

sle118 commented 3 months ago

You could possibly try to change this : https://github.com/njanik/hayward-pool-heater-mqtt/blob/0c984f4b1fd6a55f80adcd61c35d4715fb2d7776/hayward-poolheater-mqtt.ino#L27

But you would also need to change precision, precision step, etc and provide conversion from F to C here https://github.com/njanik/hayward-pool-heater-mqtt/blob/0c984f4b1fd6a55f80adcd61c35d4715fb2d7776/hayward-poolheater-mqtt.ino#L255

And C to F here https://github.com/njanik/hayward-pool-heater-mqtt/blob/0c984f4b1fd6a55f80adcd61c35d4715fb2d7776/hayward-poolheater-mqtt.ino#L550

Alternatively, you could also create a helper template that provides temperature in F, but it wouldn't be integrated to the lovelace thermostat