Still Struggling to Add Sensors

I’ve put

mqtt:
  password: something
  discovery: true

I presume “homeassistant” and “something” are the login credentials my devices must use (though I don’t see that explicitly stated anywhere). In the devices’ own console, I can see that they are connected:

00:03:01 MQT: Attempting connection...
00:03:04 MQT: Connected

I can issue power on / off commands from Developer Tools / MQTT within HAss.

I’ve also setoption19 true on all my devices.

However, when I try to create an entities card in Lovelace none of my devices are in the entities list.

What might be going on there?

I’ve also put

sensor:
  - platform: systemmonitor
    resources:
      - type: disk_use_percent
        arg: /home
      - type: memory_use_percent
      - type: processor_use

in my configuration.yaml. THis worked in my previous HassIO install, but again, teh entities don’t show up in the dropdown entity list when creating buttons.

Any clues? What have I omitted?

Are they on the state page?

http://192.168.2.150:8123/dev-state

Nope. And the Weather one has disappeared, too (it was there yesterday!) although the sunrise one is still present.

If you are using the mosquitto broker, it is set up in integrations. This is not needed in the configuration.yaml file.

Not using Mosquitto broker. Now using HA, rather than HassIO, so internal broker seemed easier.

Annoyingly, if I go to Configuration / Integrations / Configured / MQTT, my switches all appear in there as cards. They each say “No Area” and “entity unavailable”. Never seen that before. Does it give any clues?

Areas are new. Go back a page to configuration and you can set them up there. You can then assign devices to an area in the interrogations page. This has nothing to do with your problem.

Entity unavailable means there is a communication or configuration problem between your devices and HA.

Set what up? I go back a page and see the usual Integrations page.
No, areas are nothing to do with the problem, but it’s interesting that the switches appear here but not in the entities list.

Bother. They’re all happily attached, according to their own console pages and I can control them from HA’s Developer Tools / MQTT window.

On the Configuration main page look for “Area Registry”.

I would delete the integration and restart and hope they get picked up correctly then.

Is it possible for you to try to configure a switch/sensor manually (not using discovery) and see if they show up in your states page then?

Are you sure this isn’t related to your use of the internal broker? in one of the other threads you’ve created about similar topics it was recommended to not use the internal broker because people had reported issues using it.

I expect so, but that’s one of the things I struggle with, so I was hoping to do it automagically.

I’m not sure it isn’t related.

Did that and restarted. I can see from the devices’ own consoles that they disconnected from the broker, then reconnected shortly after the restart. They’re still not on the state page. I can still control them from Developer Tools / MQTT.

then maybe you should try another broker…?

I hear you, but HA comes with one. It seemed reasonable to assume it would work.

You keep ignoring the suggestions about the MQTT broker don’t you?

Even the documentation suggests using a different broker.

Accurate.

Equally accurate.

I’m a persistent sort of bugger, though. :slight_smile: Sorry.

You are correct: I never had problems like this with Mosquitto!!!

Whoop!

I deleted the entity history from http://blah:8123/config/entity_registry.

I didn’t even know there was an entity history of all the stuff HA has ever seen in the past!!

Did a reset and all working fine. Automagically discovered.

1 Like

It’s truly getting on my nerves, though. The default sensor:

> sensor:
>   # Weather prediction
>   - platform: yr

Appears in the history, appears in the log book, but has disappeared from its badge. I try to add it as a badge or a card, bu it doesn’t pop up in the list of entities.

Based on prompts from you lot, I’ve changed to running Mosquitto. It’s on the same Linux server as HA.

What’s going on there, then?

Yr is not an mqtt component. It should just appear in the entities list if you have it in your configuration file. If you look at the example at the bottom of the component page there are a bunch of other conditions you can monitor with it:

Also there are lots of other weather components you could try (darksky seems popular):

Indeed. Nor do I suggest it is.

Indeed. I do. I haven’t modifed it from the defaults.

Maybe but I just want the default (which is unmodified) to work again (after it stopped working, having not been modified).

Awwww, no! Not another “The defaults which come with Home Assistant are unreliable, try an external one!”