MQTT mosquito

There are many switches. It’s not the only one

The page had already been created before knowing home assistant.

Okay. I’ll have to do it with api rest.
Aesthetically I do not see that it is the same but I will have to use it with the home assistant. Thanks

HUH? The API isn’t ‘seen’. You can use the API and send MQTT messages too!

I know. It’s very difficult, I’m sorry to use a translator.
I mean, for example. It is not the same to use a lovelace climate card than to do it in the traditional way. Visually it is more attractive. The same happens in the timer. I do not have a card that does it. In addition to the space it occupies.

I think you are confused.

I said you can use the API which has nothing to do with the cards or what you see. You can still use your iframe webpage and instead of trying to use mqtt directly, you use the API for Home Assistant to call the MQTT for you.

You are making this way harder than it needs to be, and you could have just done this in a custom card, or straight from Home Assistant.

I said you can use the API which has nothing to do with the cards or what you see. You can still use your iframe webpage and instead of trying to use mqtt directly, you use the API for Home Assistant to call the MQTT for you.

Oh, okay. Now I understand. I’m going to do it like that.

https://192.168.0.2:8123/api say 404: Not Found
However, enable api in configuration.yaml

https://developers.home-assistant.io/docs/en/external_api_rest.html

Just browsing the api won’t work, you need the headers for authentication.

Perfect.Thanks for your help

https://192.168.0.2:8123/api/?api_password=xxxxxxxx
response {“message”: “API running.”}

curl -H “x-ha-access:xxxxxxxxx” https:/192.168.0.1t:8123/api
say curl: (51) SSL: no alternative certificate subject name matches target host name ‘192.168.0.2’

From the url it works well but from what I see it is limited. I can not send messages by mqtt.

Search but can not find what can be the solution since home assistant works well for https. That is, it recognizes the certificates

because your cert is for your domain name (DuckDNS), and not the IP. Use the fully qualified domain name and don’t use api password, use the header authentication.

Sorry, friend. I do not succeed When I use the domain, it stays on hold and does nothing

If I have to use the domain name it will be difficult for me. From inside my house that is where the raspberry is, I can only access it with the ip

If you can only access via IP, you should be running either dnsmasq or a reverse proxy.

You are going to have so many other problems if you keep going down this road with the configuration you have currently

I installed dnsmasq. If I make a telnet from the rasp it solves it. If I do it on the outside it keeps trying to leave to resolve the domain
Dnsmasq.conf

Hostal.dsnmasq

if the original domain is dom.duckdns.org now it would be raspberry pi.dom.duckdns.org?

Obviously I’m not understanding what I’m doing. If someone sees what I’m doing wrong. I need you to help me thanks