Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Entity Count #71

Closed
PhillyGilly opened this issue Mar 31, 2021 · 18 comments
Closed

Entity Count #71

PhillyGilly opened this issue Mar 31, 2021 · 18 comments

Comments

@PhillyGilly
Copy link
Contributor

I have 19 heatmiser devices in operation: 9 Neostats, 3 Neostat-E, 5 Neostat-HW and 2 repeaters.
These are all picked up and their json data is visible in my HA log file and all the Neostats are working in HA.
However I notice that only the Neostats and Neostat-E are shown under the Configuration Integration and Entities grouped by "Heatmiser Neo Climate":
image
image

The Neostat-HW switches and repeaters are reported as Entities as from the integration Switches:
image

It would be neat if the reported devices was reported accurately for an at-a-glance check and all entities were shown as being grouped under "Heatmiser Neo". I can see that the integration name is pulled from the manifest.json name field for the climate entities.

@stikonas
Copy link
Contributor

Agreed, we should properly implement devices in this integration, not just entities. I had a brief go at it but didn't get it to work. (Need to read up a bit more on home assistant API).

@PhillyGilly
Copy link
Contributor Author

PhillyGilly commented May 9, 2021

We are making good progress and my switches now show as Entities

image
However the Repeaters have disappeared from HA.
I was wondering if they can be added in switch.py as a third type.
Under a previous version I could see where to go i.e:

for device in NeoHubJson['devices']:
    if ((device['DEVICE_TYPE'] != 6) and ('TIMECLOCK' in device['STAT_MODE'])) or (device['DEVICE_TYPE'] == 6) or (device['DEVICE_TYPE'] == 10) :
        name = device['device']
        
        if ((device['DEVICE_TYPE'] != 6) or (device['DEVICE_TYPE'] != 10) :
            _LOGGER.info("Thermostat as Switch Named: %s " % name)
            switch_type = NEO_STAT
        elif(device['DEVICE_TYPE'] == 6) :
            _LOGGER.info("Neoplug Named: %s " % name)
            switch_type = NEO_PLUG
        elif(device['DEVICE_TYPE'] == 10) :
            _LOGGER.info("Repeater Named: %s " % name)
            switch_type = REPEATER
        else:
            _LOGGER.info("Something that isn't a switch or a neoplug or a repeater found!")

        switches.append(HeatmiserNeostatSwitch(hub, name, switch_type))

but now with this comment, I'm not sure
# FIXME: handle NEO_PLUG with DEVICE_TYPE == 6, needs support in neohubapi

Even if that works, it's not the whole answer as what I need to know is that the Neohub can "see" the repeaters in real time. The best answer I have to that is to create another entity which piggy backs on the repeater entity and shows it presence by changing icon.

  • platform: template
    switches:
    repeater_node_26183:
    friendly_name: "Node 1"
    value_template: "{{ is_state('switch.repeaternode26183', 'on') }}"
    turn_on:
    service: switch.turn_on
    data:
    entity_id: switch.repeaternode26183
    turn_off:
    service: switch.turn_off
    data:
    entity_id: switch.repeaternode26183
    icon_template: >-
    {% if is_state('switch.repeaternode26183', 'unavailable') %}
    mdi:access-point-off
    {% else %}
    mdi:access-point
    {% endif %}

@PhillyGilly
Copy link
Contributor Author

Just upgraded my hub to Gen2, so I will look forward to a new release too. Thanks

@PhillyGilly
Copy link
Contributor Author

PhillyGilly commented Sep 8, 2021

I have two new devices which I assume are the repeaters, but they're shown as unnamed instead of having the repeater_number as previously:
image

@PhillyGilly
Copy link
Contributor Author

Is it possible to get these unnamed devices a) named and b) Shown as part of the Heatmiser Neo Climate? Thanks

@ribbal
Copy link
Contributor

ribbal commented Dec 30, 2021

@PhillyGilly, does the latest update resolve this device/entity count issue? It seems to work for me with Neostats and a Neostat-HW (I don't have any Neostat-E or repeaters).

@PhillyGilly
Copy link
Contributor Author

PhillyGilly commented Dec 31, 2021

HI @ribbal Under the version I'm running d2bb05d I get 12 devices without duplication
image
but I still get two more entities which are the repeaters (as above).
image
I will try the latest version and get back, but I feat that I will lose the repeaters even if the duplicates are resolved (see#94).

@PhillyGilly
Copy link
Contributor Author

PhillyGilly commented Dec 31, 2021

OK, I've just upgraed to the latest available and I get the duplication again.
image
For the neostat-e I have two devices e.g.
image
with the capitalise Neostat reporting:
image
and the lowercase neostat reporting:
image

One of the unnamed devices has disappeared which suggests that the link between my two repeaters is down. Checking in the Heatmiser app confirms that the Neostat which is connected via the two repeaters is off-line. However in HA the unavailable neostat-e is still showing as active.
image

@ribbal
Copy link
Contributor

ribbal commented Dec 31, 2021

What is in the list of '29 devices'?

@PhillyGilly
Copy link
Contributor Author

image
image

@ribbal
Copy link
Contributor

ribbal commented Dec 31, 2021

Are you able to select any of those duplicate devices and remove them?

@stikonas
Copy link
Contributor

Are you able to select any of those duplicate devices and remove them?

I don't see any delete button in the device list (although I don't have any duplicate devices myself, not sure what's going on here). In some other integrations (e.g. Tasmota) I can delete devices. So I guess there is some HA API that we need to hook into for deletion to work.

@ribbal
Copy link
Contributor

ribbal commented Dec 31, 2021

No, I don't see any delete option either, but I also don't have any duplicate devices. If I recall correctly (though, can't be certain), I had to manually delete the duplicate 'floor temperature sensor' devices that roscoegray had introduced in Oct 2021 (that no longer exist now) that I think this issue may be related to.

I suspect that HA is caching some data (perhaps in the database) that may disappear over time. In this scenario, I wonder if the delete option is available.

@ribbal
Copy link
Contributor

ribbal commented Dec 31, 2021

@PhillyGilly, can I suggest you try to 'Delete' the Heatmiser Neo Climate integration and re-add it? I've done this previously without affecting any data/automations, etc..

@ribbal
Copy link
Contributor

ribbal commented Dec 31, 2021

Yep, this definitely looks like it's related to those 'floor temperature sensors' that no longer exist in the integration (based on screenshots above):

image

@PhillyGilly
Copy link
Contributor Author

PhillyGilly commented Jan 1, 2022

That worked, thank you. Maybe deleting all existing devices and entities should be part of the new release implementation?
image
And my repeaters are hanging in there as unnamed devices.
Now all I need is if(device['DEVICE_TYPE'] == 10) : switch_type = REPEATER and I will be vey happy.

@ribbal
Copy link
Contributor

ribbal commented Jan 5, 2022

@PhillyGilly, I believe that the 'Entity Count' issue has been resolved and you should see the 9 Neostats, 3 Neostat-E, 5 Neostat-HW devices that you have. The remaining issue appears to be that your repeaters are 'unnamed'.

As the message trail on this issue is quite long (and confusing), please could I ask that you close it and open a separate targeted issue related to the 'unnamed' repeaters? I believe that fixing the naming issue will result in the repeaters appearing in the device/entity list (in your last screenshot above).

@PhillyGilly
Copy link
Contributor Author

@ribbal OK. See new issue #96

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants