MindrustUK / Heatmiser-for-home-assistant

Heatmiser Neo-Hub / Neostat support for home-assistant.io
87 stars 33 forks source link

Any chance of updating Heatmiserneo #3

Closed Trouble-51 closed 4 years ago

Trouble-51 commented 5 years ago

Hi, I am using the original version for 11 thermostats. Any chance of sophisticating the project with more options that are available on the app from Heatmiser?

MindrustUK commented 5 years ago

Hi, What features are you after? Most things are limited by what the API exposes but if you have something specific in mind you can always raise a request and I'll see what I can do when I get some time.

I've only got the one stat so my testing is limited, as such I probably miss certain things.

Trouble-51 commented 5 years ago

Thanks for the quick response! One of the things is that if I put one of the thermostats on standby all 11 go to the same setting. This is obviously not the intention as it should only apply to the rooms in the house that are not being used. Now all rooms go to the set temperature of in my case 17 degrees. Another option that would be nice to have is the hold function to extra heat a particular room for an X number of hours. Thanks in advance for looking into this!

Get Outlook for iOShttps://aka.ms/o0ukef


From: MindrustUK notifications@github.com Sent: Tuesday, February 19, 2019 4:55 pm To: MindrustUK/Heatmiser-for-home-assistant Cc: Trouble-51; Author Subject: Re: [MindrustUK/Heatmiser-for-home-assistant] Any chance of updating Heatmiserneo (#3)

Hi, What features are you after? Most things are limited by what the API exposes but if you have something specific in mind you can always raise a request and I'll see what I can do when I get some time.

I've only got the one stat so my testing is limited, as such I probably miss certain things.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/MindrustUK/Heatmiser-for-home-assistant/issues/3#issuecomment-465217822, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AZej1IB7B2nmQDlW4z1nSgVQjfteM4x1ks5vPCyegaJpZM4bDWln.

MindrustUK commented 5 years ago

I've had a quick look into this last night;

The stats not responding independatly hasn't been reported by anyone else recently, someone contributed a fix to this a while ago. Until I get another Neostat-e I can't test this myself.

On the "Hold" functionality: the thermostat component has no option to enter a time, much as there is a hold function which can be used. I'm sure this could be hardcoded at a set interval. I'll need to find some time to investigate further and see if I can spawn an input field.

MindrustUK commented 5 years ago

I've also just noticed you refer to the "Orignal" version. There have been a few updates to the plugin since. Have you tested with the latest codebase?

Trouble-51 commented 5 years ago

OK, thanks! I will look into this when I am back home, I am travelling at the moment

Best regards,

Jos

On 20 Feb 2019, at 08:54, MindrustUK notifications@github.com wrote:

I've also just noticed you refer to the "Orignal" version. There have been a few updates to the plugin since. Have you tested with the latest codebase?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

rosscullen commented 5 years ago

Look forward to testing your work with Home Assistant. Have recently installed a new Heatmiser Neohub and 6 x Neostats

haakonstorm commented 5 years ago

Count me in on any beta testing. Two neo-e thermostats up, four more in house to install. Keep up the great work! Storm

Trouble-51 commented 5 years ago

I think I am getting there but after the latest hassio update  I get the following warning:

WARNING (MainThread) [homeassistant.helpers.config_validation] Your configuration contains extra keys that the platform does not support. Please remove [debug]. (See /config/configuration.yaml, line 114).

And the line 114 in config is:

114 climate:

115   - platform: heatmiserneo

116     host: 192.168.1.28

117     port: 4242

118     debug: True

I did change the file name in custom_components to climate.py in a folder named heatmiserneo  based on the instructions

This is a screenshot:

Study Jos and Living & Kitchen are a combination of Heatmiserneo and Netatmo, the others just Heatmiserneo.  Are the latter not missing the on and off button? The ones on the right are Melcloud

Thanks again for your help,

Jos  

From: MindrustUK notifications@github.com Reply-To: MindrustUK/Heatmiser-for-home-assistant reply@reply.github.com Date: Wednesday, 20 February 2019 at 08:54 To: MindrustUK/Heatmiser-for-home-assistant Heatmiser-for-home-assistant@noreply.github.com Cc: Trouble-51 josderaaij@gmail.com, Author author@noreply.github.com Subject: Re: [MindrustUK/Heatmiser-for-home-assistant] Any chance of updating Heatmiserneo (#3)

I've also just noticed you refer to the "Orignal" version. There have been a few updates to the plugin since. Have you tested with the latest codebase?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

Trouble-51 commented 5 years ago

Apologies for the incomplete information.

The version of Hassio I use is: 88.1

The version of heatmiserneo.py (renamed to climate.py) is: https://github.com/MindrustUK/Heatmiser-for-home-assistant/commit/93b0ca24841dc2a67e5e10454f41a4d9acd9ffd4

The latter gives the following state information:

climate.living_and_kitchen heat current_temperature: 22.4 min_temp: 7 max_temp: 35 temperature: 23 away_mode: off friendly_name: Living and Kitchen supported_features: 1025

When I press the temperature in the “simple temperature card” it shows the following:

When I put this in Away mode all thermostats go in Away mode not just this one and it are shown as “Idle”  the same as when the heating is not active .

On the iPhone App, Away mode is called “Standby”

There is no “Hold” available.

I hope the info in the two emails will be of help!

Best regards,

Jos

From: Jos de Raaij josderaaij@gmail.com Date: Saturday, 23 February 2019 at 22:33 To: MindrustUK/Heatmiser-for-home-assistant reply@reply.github.com, MindrustUK/Heatmiser-for-home-assistant Heatmiser-for-home-assistant@noreply.github.com Cc: Author author@noreply.github.com Subject: Re: [MindrustUK/Heatmiser-for-home-assistant] Any chance of updating Heatmiserneo (#3)

I think I am getting there but after the latest hassio update I get the following warning:

WARNING (MainThread) [homeassistant.helpers.config_validation] Your configuration contains extra keys that the platform does not support. Please remove [debug]. (See /config/configuration.yaml, line 114).

And the line 114 in config is:

114 climate:

115 - platform: heatmiserneo

116 host: 192.168.1.28

117 port: 4242

118 debug: True

I did change the file name in custom_components to climate.py in a folder named heatmiserneo based on the instructions

This is a screenshot:

Study Jos and Living & Kitchen are a combination of Heatmiserneo and Netatmo, the others just Heatmiserneo. Are the latter not missing the on and off button? The ones on the right are Melcloud

Thanks again for your help,

Jos

From: MindrustUK notifications@github.com Reply-To: MindrustUK/Heatmiser-for-home-assistant reply@reply.github.com Date: Wednesday, 20 February 2019 at 08:54 To: MindrustUK/Heatmiser-for-home-assistant Heatmiser-for-home-assistant@noreply.github.com Cc: Trouble-51 josderaaij@gmail.com, Author author@noreply.github.com Subject: Re: [MindrustUK/Heatmiser-for-home-assistant] Any chance of updating Heatmiserneo (#3)

I've also just noticed you refer to the "Orignal" version. There have been a few updates to the plugin since. Have you tested with the latest codebase?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

MindrustUK commented 5 years ago

Hi Jos,

The debug key can be removed. From the config, that will get rid of the error your seeing.

With regards to screenshots they aren't appearing in GitHub. Can you upload these to imgur or similar and link to them?

also consider when replying clearing down the previous email trail or reply on GitHub as it's creating a lot of very long threads.

haakonstorm commented 5 years ago

Perhaps this can be of use? https://github.com/kenny000666/HeatmiserNeo/blob/master/NeoHubInterface.py

haakonstorm commented 5 years ago

Are there any installation instructions regarding adding this as a custom components when running HA in HASSIO on a RPi3B+ ?

MindrustUK commented 5 years ago

@haakonstorm Please raise requests in a separate issue. I'd suggest one for documentation in your case. I'll have a look at maybe writing something up on the wiki.

Trouble-51 commented 5 years ago

@mindtrustUK: I hardly dare ask as I know that you don't have much time to work on the .py file, but I do it anyway: I am using lovelace card "simple thermostat" which should show buttons but doesn't

Screenshot 2019-03-24 at 08 38 48

I also have Mitsubishi air conditioners which uses Melcloud (climate.py) and the do show buttons in the same simple thermostat card:

Screenshot 2019-03-24 at 08 38 02

my question is whether it would be possible to add buttons for heatmiserneo?

The Melcloud "states" have the following information:

Screenshot 2019-03-24 at 08 48 47

I guess the "operation mode" and "operation list" does the trick.

Could the applicable options be included in the climate.py file of the Neo?

MindrustUK commented 5 years ago

Returning operation mode should be trivial. I'll see if I can fit it in next time I look at the code. Last I looked at this I resolved away mode being applied to all thermostats at the Neohub layer but now HASS is doing some strange and not refusing to update status.

Trouble-51 commented 5 years ago

I tried the away mode using the simple thermostat and all rooms went to away mode that weren't already in that mode. When I switched it back all rooms, with the exception of the rooms that were set in away mode on the app on the iPhone, went back to idle and the set temperature.

MindrustUK commented 5 years ago

Sorry, my previous statement may have been confusing. I have not pushed the away functionality to public yet as it's still doing some werid stuff I'm not happy with. Updates when I get to it again.

Trouble-51 commented 5 years ago

Thanks, sorry to be a pain!!

From: MindrustUK notifications@github.com Reply-To: MindrustUK/Heatmiser-for-home-assistant reply@reply.github.com Date: Wednesday, 27 March 2019 at 08:40 To: MindrustUK/Heatmiser-for-home-assistant Heatmiser-for-home-assistant@noreply.github.com Cc: Trouble-51 josderaaij@gmail.com, Author author@noreply.github.com Subject: Re: [MindrustUK/Heatmiser-for-home-assistant] Any chance of updating Heatmiserneo (#3)

Sorry, my previous statement may have been confusing. I have not pushed the away functionality to public yet as it's still doing some werid stuff I'm not happy with. Updates when I get to it again.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

simonsmart99 commented 5 years ago

Hi MindrustUK. This is great work with Heatmiser Neo. I have a 15 device setup of which 14 are configured as thermostats and 1 has been configured as a clock to control the heating of the hot water cylinder.

Of the 14 thermostats, 6 are NeoStat and 8 are NeoAir, all talking to a V2 Gen NeoHub. I am happy to be used as a test site if this helps.

Heatmiser Entity Card

Heatmiser Thermostat Card

Comments:

  1. There are no control buttons on the Thermostat Card. I presume you are looking at incorporating the standard Heatmiser functions of "Auto", "Hold" and "Standby"?

  2. When a NeoStat is configured as a clock, the Idle temp in HA displays 238 degC. I presume your script is interpreting data as a temperature even when the device is configured as a clock. I presume the data in this case could be a switching time? Not at all sure.

Questions:

  1. Is it possible to call the current temperature of a device within an automations script. IE I would like to switch a smartplug on when the current temperature exceeds 20 deg. (Sorry, very much a beginner)

Any questions please ask.

Regards Simon

MindrustUK commented 5 years ago

Hi Simon,

Unfortunately life has a habit of keeping me busy at the minute, most of this still on my list to get round to.

Standard functions: "Auto", "Hold" and "Standby", I was having some challenges with regards to time entry and the HASS UI I need to revisit. This is due to when asserting "Hold" a time is required and I wanted a nice way to feed this in without relying on a separate data source or fixed variable.

Time clock: there's an open issue here; [https://github.com/MindrustUK/Heatmiser-for-home-assistant/issues/2]() I'm going to get to when I have a bit more tinkering time. This is also affecting the NeoPlug hardware support I plan on adding (They also present as a time clock of sorts). The suggestion of a switching time is a good one. I don't actually know what "Time Clock" mode really means so I have to do more reading before I can provide a 'Good' answer to this.

An example of an automation based on time criteria can be executed as follows:

- alias: 'Set kitchen heating to 22 Deg C at 6:30 on Weekdays'
  trigger:
   - platform: time
     at: '06:30:00'

  condition:
   - condition: time
     weekday:
       - mon
       - tue
       - wed
       - thu
       - fri

  action:
    service: climate.set_temperature
    entity_id: climate.kitchen
    data: {"temperature": 22}

Hope that helps, please check other issues for updates on specifics and feel free to raise new issues for things not already identified.

simonsmart99 commented 5 years ago

I have also noticed that the "away mode" function doesn't have any affect on my system. Heatmiser differentiate between "away" and "standby". If you select "away" on the app this will set all devices into away mode, and you cannot choose to keep one active. This includes clocks.

The standby function is selected within each thermostat, and is used when a room is not being used and does not need heating. This is an individual setting for each thermostat.

I hope this helps.

If you want me to test anything, please feel free to send me an update.

simonsmart99 commented 5 years ago

Many thanks for your response. Regarding the automation, I was wanting to compare the actual room temperature to a specific value, and switch a smartplug if the temperature exceeds that value. Something like this:

- alias: 'Switch smartplug when ensuite temperature exceeds 22 Deg C'
  trigger:
    platform: template
    data_template: {{states.climate.guest_ensuite.current_temperature > 22 deg}}

  action:
  - service: homeassistant.turn_off
    entity_id: switch.smartplug_ensuite

The problem is I don't know how to extract just the current room temperature out of the climate.guest_ensuite data.

MindrustUK commented 5 years ago

Hi @simonsmart99 That looks right at a quick glance, however I suggest you try the HASS forums. I'm not sure you can trigger on temperature, I think you can only use it as a condition. I haven't done much investigation but you may get better input from the forums.

simonsmart99 commented 5 years ago

I did some research on the HASS forums, and came up with the following solution if anyone wants to try this.

First define a new sensor for the current room temperature in configuration.yaml

# Sensors
sensor:
  # Climate temperature
  - platform: template
    sensors:
      boiler_room_temp:
        friendly_name: "Boiler Room Temperature"
        unit_of_measurement: '°C'
        value_template: "{{states.climate.boiler_room_clock.attributes.current_temperature}}"

Then in automations.yaml

###############################################################
## Heating Control
###############################################################   

- id: boiler_room_over_temp
  alias: Boiler room over temperature
  trigger:
    platform: template
    value_template: "{{states('sensor.boiler_room_temp')|float > 27|float}}"

  action:
  - service: homeassistant.turn_on
    entity_id: switch.sonoff_smartplug

- id: boiler_room_under_temp
  alias: Boiler room under temperature
  trigger:
    platform: template
    value_template: "{{states('sensor.boiler_room_temp')|float < 27|float}}"

  action:
  - service: homeassistant.turn_off
    entity_id: switch.sonoff_smartplug

Works very well.

MindrustUK commented 5 years ago

@simonsmart99 Can you send me the output of printf '{"INFO":0}\0' | nc <NEOHUBIP> 4242 (Please review for sensitive information before you post) so I can see some examples of time clock behaviour. As this doesn't report / handle temperature there may be a need to address the use case differently in HASS.

simonsmart99 commented 5 years ago

Sorry for the noob question, but where should I run this command. I have run it in the root directory of the rPi running HASS, but it returns nothing. printf '{"INFO":0}\0' | nc 192.168.0.232 4242

MindrustUK commented 5 years ago

Hi @simonsmart99 it's possible netcat may not be installed try the following and then repeat the command as previous:

apt-get update ; apt-get install netcat

simonsmart99 commented 5 years ago

Sorry, apt-get is not installed on HASSIO. I am working on it.

I have just upgraded to latest HA, and now my heatmiserneo platform is not recognised when I check the config. Anyone else had the same problem?

MindrustUK commented 5 years ago

Hmmm hassio should already have NetCat installed, try running which nc and see if is on the path.

Answers around 0.92 can be found here https://github.com/MindrustUK/Heatmiser-for-home-assistant/issues/10

simonsmart99 commented 5 years ago

OK, I worked out what I had done wrong. I have a response from the nc command now. What's the best way of copying the output from command prompt into windows so I can send it to you?

simonsmart99 commented 5 years ago

sorted that too. please ignore

simonsmart99 commented 5 years ago

This is one very long output file. How would you like me to send it to you?

simonsmart99 commented 5 years ago

heatmsierneo_output.docx

simonsmart99 commented 5 years ago

The reason my configuration is no longer working is because of the integration changes implemented in Home Assistant 0.92. Is there a possibility you could update your installation instructions according to the guidelines? I have tried a few things, but its beyond me. Many thanks.

https://developers.home-assistant.io/blog/2019/04/12/new-integration-structure.html
Trouble-51 commented 5 years ago

Mine is working. No changes to config.yaml and the following files in custom_components:

From: simonsmart99 notifications@github.com Reply-To: MindrustUK/Heatmiser-for-home-assistant reply@reply.github.com Date: Tuesday, 30 April 2019 at 13:10 To: MindrustUK/Heatmiser-for-home-assistant Heatmiser-for-home-assistant@noreply.github.com Cc: Trouble-51 josderaaij@gmail.com, Author author@noreply.github.com Subject: Re: [MindrustUK/Heatmiser-for-home-assistant] Any chance of updating Heatmiserneo (#3)

The reason my configuration is no longer working is because of the integration changes implemented in Home Assistant 0.92. Is there a possibility you could update your installation instructions according to the guidelines? I have tried a few things, but its beyond me. Many thanks. https://developers.home-assistant.io/blog/2019/04/12/new-integration-structure.html — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

haakonstorm commented 5 years ago

@simonsmart99 :

I actually also deleted the Python cache __pycache__ folder and files inside, don't know if this is good, bad, necessary or not, but I got my thermostats back up and running.

simonsmart99 commented 5 years ago

@haakonstorm 👍 Many thanks. That sorted it.

simonsmart99 commented 5 years ago

I thought I would give you an update. Herewith the new screenshot, with buttons on the thermostat card. None of the buttons are functional, and I receive the following message when I click on any of them.

Failed to call service climate/set_operation_mode

Also the boiler device which is configured as a clock still has the idle setpoint as "238".

heatmiserneo_latest

Trouble-51 commented 5 years ago

Hi, after the last update this is what i get when pressing the temperature:

Screenshot 2019-09-13 at 13 03 37

the thermostat is on idle but it says (heat) between brackets. When I increase the temperature I hear the thermostat and is changes to Heating (Heat)

Screenshot 2019-09-13 at 13 10 03

In the "states" I only see "havac_modes": Heat but under "havac_action" either :Heat or :Idle. It also shows the actual temperature

There are no modes for away, idle, cool etc.

Trouble-51 commented 5 years ago

Hi any chance of an update of heatmiserneo. I get the following error: Platform error climate.heatmiserneo - Integration 'heatmiserneo' not found. Notsure what this means and what to do about it. Help would be very much appreciated!

haakonstorm commented 5 years ago

Hi Trouble-51! We might help you but would need more details about your setup. The heatmiserneo works perfectly here on latest ha, see screenshot-.

Trouble-51 commented 5 years ago

Hi Haakonstorm, I also use simple thermostat, which works fine with Melcloud for my airco's but no luck with heatmiserneo anymore

here are the screen shots of my configuration and custom-components files:

Screenshot 2019-10-30 at 07 16 40 Screenshot 2019-10-30 at 07 17 41
Trouble-51 commented 5 years ago

After rebooting as opposed restarting the thermostats are back!! Thanks for pointing that out.

Having said that i only have one state which is "heat"and when i push on it I get the following message: Failed to call service climate_sethvac mode. Any idea why that is? Can you let share your lovelace setting for your thermostat?

Trouble-51 commented 5 years ago
Screenshot 2019-10-30 at 08 37 34
haakonstorm commented 5 years ago

No big surprises:

- platform: heatmiserneo
  host: 192.168.1.14
  port: 4242

this is what I would have done in your place your results may vary!

  1. check that your IP is still correct, I have assigned a static IP for my hub based on the MAC-address of the hub. You can get the MAC-address by first finding and verifying the IP of your hub hasn't changed, use your terminal of choice (iterm2 is good): nmap -Pn -p4242 -oG - 192.168.1.0/24 | grep 4242 | grep -i open lets say your hub IP is 192.168.1.2, then you ping it: ping 192.168.1.2 -t 5 this will stop after 5 seconds. now your machine has stored the MAC address for the hub in its ARP table, which you can query like this: arp 192.168.1.2 now open your routers admin interface and add a static IP for the MAC address, so that 192.168.1.2 is always assigned to the hub MAC.

  2. take a full backup of your hass installation, ideally both a snapshot and a clone of the memory card if you are on hassio with sdcard

2.1 comment out the heatmiserneo section in your configuration.yaml and save

  1. log in to your hassio instance over port 22 ssh root@192.168.1.2 and go to your custom components cd config/custom_components

  2. stop home assistant hassio ha stop

  3. remove your heatmiserneo integration rm -rf heatmiserneo and perhaps rm -rf heatmiserneoplug

  4. start home assistant hassio ha start wait for finish

  5. reboot your host hassio host reboot

  6. wait for everything to come back up, then reboot again either via hassio host reboot in the gui or via ssh as above. yes *twice reboot

  7. clone this repository, I would suggest using GitHub Desktop or similar GUI app if you are more comfortable with that; easier to upgrade.

  8. i would not follow the suggested procedure written in this repo readme for installing. i would not git clone directly to the home assistant working directory for custom_components. try cloning to your local machine and copy the files over manually, to the directory config/custom_components/heatmiserneo

  9. uncomment the reference to heatmiserneo section in configuration.yaml, you've now both reinstalled the code and set up configuration.yaml to  run it again

  10. save everything, then reboot

  11. reboot again as soon as it is up and running

  12. should be good to go

Trouble-51 commented 5 years ago

thanks for your very clear input.

However i get the following error message after rebooting:

Platform error climate.heatmiserneo - cannot import name 'STATE_AUTO' from 'homeassistant.components.climate.const' (/usr/src/homeassistant/homeassistant/components/climate/const.py)

any idea what to do about that? As a result there are no "climate states" in the state option relating to heatmiser.

Trouble-51 commented 5 years ago

PS: i just got back from an overseas trip, hence my delayed message

Trouble-51 commented 5 years ago

and the thermostats look like this:

Screenshot 2019-11-02 at 15 23 00

the words are: entity not available for "all the names in lovelace"

Trouble-51 commented 5 years ago

I found a more detailed message which probably explain the error better:

File "/config/custom_components/heatmiserneo/climate.py", line 14, in from homeassistant.components.climate.const import ( ImportError: cannot import name 'STATE_AUTO' from 'homeassistant.components.climate.const' (/usr/src/homeassistant/homeassistant/components/climate/const.py)

Trouble-51 commented 5 years ago

I copied the raw climate.py into the custom components/heatmiser folder and got back to where i started

Hopefully mindtrust will find some time to get the climate.py file unto date with the new HVAC structure