Giter VIP home page Giter VIP logo

Comments (19)

toblum avatar toblum commented on August 19, 2024

Hi,

I think there is already a way to implement this with Home Assistant using the REST API, but I don't know HomeAssisant in detail. Nevertheless MQTT would be nice to have and I definitely will look into this when I find time. The PubSub library uses some additional RAM and memory, so I will have to try out if it's working with all libraries enabled.

If you or someone else will do the first step on the integration I would definitely integrate this into McLighting.

Regards
Tobias

from mclighting.

thundergreen avatar thundergreen commented on August 19, 2024

+1 for home assistant integration with MQTT. I will maybe buy another esp to test this :)

from mclighting.

LeonVos avatar LeonVos commented on August 19, 2024

i just added MQTT to MCLighting.ino.
Page is in request

master...LeonVos:patch-1

from mclighting.

thundergreen avatar thundergreen commented on August 19, 2024

Awesome! It's already in master branch ? Wanna check this out

from mclighting.

thundergreen avatar thundergreen commented on August 19, 2024

from mclighting.

thundergreen avatar thundergreen commented on August 19, 2024

I overflew the file and couldn't locate mqtt username and password . Neither topic .I might have read a bit too fast and on the phone but I was just wondering if I miss something ?

from mclighting.

LeonVos avatar LeonVos commented on August 19, 2024

User&Passw is not needed for this , topics are at the end (ws2812-set/mode, ws2812-set/state )

Remind you that the control for mode does not work yet.

I use io-broker, for H.A.. integration search for " mqtt home assistant" lots off sources for it.

from mclighting.

thundergreen avatar thundergreen commented on August 19, 2024

from mclighting.

toblum avatar toblum commented on August 19, 2024

@LeonVos Great! I will have a look at it as soon as I'm back from holidays and find time.

Could you file this as a pull request in the McLIghting repo? Then I will create a standalone branch where we can test and do enhancements.

Regards

from mclighting.

toblum avatar toblum commented on August 19, 2024

Plese have a look here: #26 (comment)

from mclighting.

nimbl avatar nimbl commented on August 19, 2024

First off, thanks for the great repo. I have two things to mention in reference to this new MQTT functionality that was added to the master branch.

  1. I suggest refactoring the infinite mqtt connection loop to give up after a few retries. Right now, if the mqtt connection isn't established, then the webserver and websocket server will hang. At: I suggest something like this instead:
    if (!mqtt_client.connected()) { if(mqtt_reconnect_retries < mqtt_reconnect_retries_max){ mqtt_reconnect(); } }else{ mqtt_client.loop(); }
  2. As a hint as to why large messages aren't working in pubsubclient, as mentioned in this todo:
    // TODO: Fix this, doesn't return anything. Too long?

It seems that the pubsubclient doesn't respect redefining of MQTT_MAX_PACKET_SIZE, as you have in definitions.h. So any message over 128 bytes won't be sent. You can change this as a build option if using PlatformIO, but not with the Arduino IDE. See this issue knolleary/pubsubclient#110

Hope this info helps, and I'm not posting this into the wrong place. Thanks for the excellent software.

from mclighting.

toblum avatar toblum commented on August 19, 2024

Thank you @nimbl. I will have a look at it as soon I find time.

from mclighting.

thundergreen avatar thundergreen commented on August 19, 2024

why do i get

*WM: host
*WM: Adding parameter
*WM: port
*WM: Adding parameter
*WM: user
*WM: Adding parameter
*WM: pass
*WM: 
*WM: AutoConnect
*WM: Connecting as wifi client...
*WM: Using last saved values, should be faster

and it just wont connect and how is the wifimanager supposed to work? which address do i have to type in?

from mclighting.

LeonVos avatar LeonVos commented on August 19, 2024

Hi, you need to connect your wifi with the esp (ssid looks like "espxxxx") default ip is 192.168.1.4

from mclighting.

toblum avatar toblum commented on August 19, 2024

IP should be: 192.168.4.1 I think
@thundergreen It Looks like your Board has stored valid credentials. Maybe you used it with wifimanager before.
You could uncomment the line with wifimanager.resetsettings(). In McLighting.ino. Then run one time to reset everything. Then comment it again.

from mclighting.

thundergreen avatar thundergreen commented on August 19, 2024

how would i reset it then ? will try this again now

from mclighting.

thundergreen avatar thundergreen commented on August 19, 2024

i reset it by uncommenting .. commted it again and it runs as accesspoint now .. strange

from mclighting.

toblum avatar toblum commented on August 19, 2024

Dear @thundergreen,
I hope everything is OK now. I will close the issue. If there are still problems, please just open a new issue.
Regards
Tobias

from mclighting.

toblum avatar toblum commented on August 19, 2024

@nimbl
As proposed by you, I added a limit to the MQTT connections tries: 91571ea

from mclighting.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.