News:

LATEST RELEASE:  FPP 8.5.1 - Download from here - https://github.com/FalconChristmas/fpp/releases/tag/8.5

+-+-

+-User

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+-Site Stats

Members
Total Members: 16969
Latest: eglass90
New This Month: 7
New This Week: 2
New Today: 1
Stats
Total Posts: 135734
Total Topics: 17043
Most Online Today: 168
Most Online Ever: 7634
(January 21, 2020, 02:14:03 AM)
Users Online
Members: 1
Guests: 153
Total: 154

MQTT with Home Assistant, model control only lights up some pixels.

Started by madsci1016, April 02, 2024, 02:49:23 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

madsci1016

I have FPP loaded with models of my props (just 5 snowflakes). Per model testing works fine, as in if i say test snowflake 1, just snowflake 1 lights up in entirety.

Got MQTT /HA plug installed, set it to push my 5 snowflakes. They were detected and added by Home Assistant. However when i click to turn on snowflake 1 in home assistant, a random 8 pixels light up red when the whole model should be white. And thats it.

Pixel controller is an pixelstick running old firmware if that matters, but again, test mode in FPP works correctly.

Json i see in MQTT is


I do get some log entries in FPP
[pre][color=#171720][size=2][font=Verdana, Arial, Helvetica, sans-serif]2024-04-02 15:27:40.388 (4899) [Command] /opt/fpp/src/commands/Commands.cpp:271: No command found for ""
2024-04-02 15:28:10.833 (4899) [Command] /opt/fpp/src/commands/Commands.cpp:271: No command found for ""
2024-04-02 15:29:42.824 (4899) [Command] /opt/fpp/src/commands/Commands.cpp:271: No command found for ""
2024-04-02 15:29:54.401 (4899) [Command] /opt/fpp/src/commands/Commands.cpp:271: No command found for ""
2024-04-02 15:41:43.180 (4899) [Command] /opt/fpp/src/commands/Commands.cpp:271: No command found for ""
2024-04-02 15:41:47.973 (4899) [Command] /opt/fpp/src/commands/Commands.cpp:271: No command found for ""[/font][/size][/color][/pre]




I have not setup any effects (or "FPP Commands FOR HA LIGHT EFFECTS" as the GUI says) in FPP. Didn't think i'd need to for just on/off and color control.

Is this expected behavior and i missed something, or a bug?

FPP  v8.x-master-181-gc36751c8 (master branch)

@CaptainMurdoch ?

madsci1016

Hmm as i try different colors values for the prop from HA the few red pixel lit up will fade in and out like they are some how the sub color RGB values being sent to FPP but being rendered as red pixels instead of a color wash over the full model. 

So pixel each individually respond (in red only) to the r,g,b values as:

(Pixel number - color vale controlling it)
4,5 - red
46 -  green
1,47 (and a few more) - blue

Bug? 

CaptainMurdoch

The HA plugin uses the "Overlay Model Fill" FPP Commands to fill the model with color so it should work for all pixels.  I just tested on my dev system running docker and latest FPP master code and it worked correctly.

You can get more debug logs out of the plugin by setting the 'plugin' log level to 'Excessive'.

Your MQTT values match mine, here is an example of what I see when HA turns the light on/off and changes colors:

falcon/player/fpp-dev/ha/light/LEDPanels/cmd {"state":"ON"}
falcon/player/fpp-dev/ha/light/LEDPanels/state {"brightness":255,"color":{"b":255,"g":255,"r":255},"color_mode":"rgb","effect":"","state":"ON"}
falcon/player/fpp-dev/ha/light/LEDPanels/cmd {"state":"ON","color":{"r":255,"g":158,"b":242}}
falcon/player/fpp-dev/ha/light/LEDPanels/state {"brightness":240,"color":{"b":241,"g":157,"r":255},"color_mode":"rgb","effect":"","state":"ON"}
falcon/player/fpp-dev/ha/light/LEDPanels/cmd {"state":"ON","color":{"r":255,"g":253,"b":249}}
falcon/player/fpp-dev/ha/light/LEDPanels/state {"brightness":240,"color":{"b":248,"g":252,"r":255},"color_mode":"rgb","effect":"","state":"ON"}
falcon/player/fpp-dev/ha/light/LEDPanels/cmd {"state":"OFF"}
-
Chris

madsci1016

Quote from: CaptainMurdoch on April 02, 2024, 04:09:07 PMThe HA plugin uses the "Overlay Model Fill" FPP Commands to fill the model with color so it should work for all pixels.  I just tested on my dev system running docker and latest FPP master code and it worked correctly.

You can get more debug logs out of the plugin by setting the 'plugin' log level to 'Excessive'.

Your MQTT values match mine, here is an example of what I see when HA turns the light on/off and changes colors:

falcon/player/fpp-dev/ha/light/LEDPanels/cmd {"state":"ON"}
falcon/player/fpp-dev/ha/light/LEDPanels/state {"brightness":255,"color":{"b":255,"g":255,"r":255},"color_mode":"rgb","effect":"","state":"ON"}
falcon/player/fpp-dev/ha/light/LEDPanels/cmd {"state":"ON","color":{"r":255,"g":158,"b":242}}
falcon/player/fpp-dev/ha/light/LEDPanels/state {"brightness":240,"color":{"b":241,"g":157,"r":255},"color_mode":"rgb","effect":"","state":"ON"}
falcon/player/fpp-dev/ha/light/LEDPanels/cmd {"state":"ON","color":{"r":255,"g":253,"b":249}}
falcon/player/fpp-dev/ha/light/LEDPanels/state {"brightness":240,"color":{"b":248,"g":252,"r":255},"color_mode":"rgb","effect":"","state":"ON"}
falcon/player/fpp-dev/ha/light/LEDPanels/cmd {"state":"OFF"}

Here's my log at excessive :
[pre][color=#171720][size=2][font=Verdana, Arial, Helvetica, sans-serif]2024-04-02 17:31:30.494 (1921) [Plugin] src/FPP-HomeAssistant.cpp:526: Command: {"state":"ON"}
2024-04-02 17:31:30.494 (1921) [Plugin] src/FPP-HomeAssistant.cpp:561: Light Config Received: {"state":"ON"}
2024-04-02 17:31:30.494 (1921) [Plugin] src/FPP-HomeAssistant.cpp:654: Merged Light Config: {"brightness":255,"color":{"b":255,"g":255,"r":255},"state":"ON"}
2024-04-02 17:31:30.494 (1921) [Plugin] src/FPP-HomeAssistant.cpp:671: FPP Command: {"args":["ChromaFlake-1","Enabled","#FFFFFF"],"command":"Overlay Model Fill"}
2024-04-02 17:31:33.019 (1921) [Plugin] src/FPP-HomeAssistant.cpp:525: Received a light command for light: ChromaFlake-1
2024-04-02 17:31:33.019 (1921) [Plugin] src/FPP-HomeAssistant.cpp:526: Command: {"state":"OFF"}[/font][/size][/color][/pre]




This is the flake when channel testing. 


And when my HA posts that MQTT message:
[color=rgba(0, 0, 0, 0.87)][size=2][font=Arial][b]config[/b] = {"brightness":true,"command_topic":"falcon/player/fpp-virt/ha/light/ChromaFlake-1/cmd","device":{"configuration_url":"http://fpp-virt/plugin.php?_menu=content&plugin=fpp-HomeAssistant&page=plugin_setup.php","identifiers":["fpp-virt_ChromaFlake-1"],"manufacturer":"Falcon Player","name":"fpp-virt ChromaFlake-1","sw_version":"8.x-master-181-gc36751c8","via_device":"fpp-virt"},"effect":false,"name":"f...[/font][/size][/color]
[color=rgba(0, 0, 0, 0.87)][size=2][font=Arial][b]state[/b] = {"brightness":255,"color":{"b":255,"g":255,"r":255},"color_mode":"rgb","effect":null,"state":"ON"}[/font][/size][/color]
[color=rgba(0, 0, 0, 0.87)][size=2][font=Arial][b]cmd[/b] = {"state":"ON"}[/font][/size][/color]




CaptainMurdoch

What happens if you run the "Overlay Model Fill" FPP Command manually on that model?  The channel tester is testing channels directly, but the plugin is using the FPP Command to turn on the model and fill the model with a color.  I'm not seeing how the plugin could be broken unless the command wasn't working for some reason.  Do you perhaps have two pixel overlay models with the same name?
-
Chris

madsci1016

Quote from: CaptainMurdoch on April 02, 2024, 05:00:10 PMWhat happens if you run the "Overlay Model Fill" FPP Command manually on that model?  The channel tester is testing channels directly, but the plugin is using the FPP Command to turn on the model and fill the model with a color.  I'm not seeing how the plugin could be broken unless the command wasn't working for some reason.  Do you perhaps have two pixel overlay models with the same name?
I tried 



And it's the same result, just a few red pixels. 

CaptainMurdoch

Can you try deleting the model and recreating by hand and then retesting manually with the FPP Command?  Maybe delete all other models to make sure there is nothing else affecting it.  If that doesn't help then we may need to see the configs to try to reproduce.  There isn't much that could affect this that I can think of.
-
Chris

madsci1016

Quote from: CaptainMurdoch on April 02, 2024, 11:26:21 PMCan you try deleting the model and recreating by hand and then retesting manually with the FPP Command?  Maybe delete all other models to make sure there is nothing else affecting it.  If that doesn't help then we may need to see the configs to try to reproduce.  There isn't much that could affect this that I can think of.
Yes, if i delete the "custom" models that were created by the xLights FPP connect, and create new (generic channel) models with the same name, everything, including MQTT and HA control, works as intended. 

Thats gets me what i need. What can i do to help you debug the issue with xLights pushing a bad model onto FPP? What files would you need exactly? (i'm not familiar with FPP config file structure or debugging it in general, because it's just always worked for the years i've used it, so thanks). 

I'm setting up a micro Dell computer with Proxmox, with VMs including OpenWRT, Home Assistant, FPP, Frigate and a few others to help me teach my Camera AI / HA / FPP automation class at the Florida and California Minis this year. Really happy with how it's turning out, its a little virtual lab space to play with the integrations of all those appliances. OpenWRT runs the virtual network and uses the Dell's wifi card to setup an wifi AP, which the smart plug and pixelstick controller connect to.

 

CaptainMurdoch

The file /home/fpp/media/config/model-overlays.json contains the models.  If you attach it here I'll take a look and see if I can reproduce the issue.  You can download it directly from your FPP instance by hitting http://your_fpp_ip/api/configfile/model-overlays.json
-
Chris

madsci1016

Quote from: CaptainMurdoch on April 03, 2024, 08:24:36 AMThe file /home/fpp/media/config/model-overlays.json contains the models.  If you attach it here I'll take a look and see if I can reproduce the issue.  You can download it directly from your FPP instance by hitting http://your_fpp_ip/api/configfile/model-overlays.json
_bad is the one that xlights FPP connect uploaded
_good is the manual string one. 
https://drive.google.com/file/d/18iaJTagiieuh9E36tw9emBDrGy2icrWD/view?usp=drive_link 

Poporacer

There are 2 method of creating Overlay models. 
One is to Upload them by checking the Models checkbox and this is not typically recommended unless you have some sort of specialized testing situation or need to create models on a Player that you need to use for sending info to remotes. 
The recommended method is to use the Auto Create Models in the Overlay models section.
When you upload the Models in FPP Connect, it will use that info to "override" any models defined automatically and you could have some bad Manual models in there. Can you post a screenshot of your Model overlay section?
If to err is human, I am more human than most people.

madsci1016

Quote from: Poporacer on April 03, 2024, 10:22:13 AMThere are 2 method of creating Overlay models.
One is to Upload them by checking the Models checkbox and this is not typically recommended unless you have some sort of specialized testing situation or need to create models on a Player that you need to use for sending info to remotes.
The recommended method is to use the Auto Create Models in the Overlay models section.
When you upload the Models in FPP Connect, it will use that info to "override" any models defined automatically and you could have some bad Manual models in there. Can you post a screenshot of your Model overlay section?

Quote from: Poporacer on April 03, 2024, 10:22:13 AMOne is to Upload them by checking the Models checkbox and this is not typically recommended
I'm a little confused if the plan is to not recommend this. I was under the impression development in general was working towards supporting the automatic configuration of FPP and FPP based controllers from xLights for ease of use overall, and pushing models would continue that workflow. Meaning i found a bug we'd want to fix, not a "you were using it wrong" type response. 

I didn't need it for my use right now, I'm just asking to see if my understanding of this philosophy is correct or needs adjusted before i continue to teach new users about xlights and FPP.

Poporacer

Thanks for the screenshot! They really help.

It looks like there might be some other things going on? (or a bug) Do you have more than one FPP device? The reason I ask is because the device you posted has the Auto Created Pixel Overlay models checked, but no models defined in that section...Can you clarify if you are using more than one FPP device in your situation? If you are not using more than one FPP Device, can you post a screenshot of the String output page?

Quote from: madsci1016 on April 03, 2024, 10:33:48 AMI was under the impression development in general was working towards supporting the automatic configuration of FPP and FPP based controllers from xLights for ease of use overall
You are partially correct there, yes supporting automatic configuration is the goal but there are use cases for both methods and they will both work (if used properly!) That is why they added the Auto Configure in FPP to make Automation even more automated, no need to upload models.

xLights and FPP have developed tremendously over the last few years and many times they keep the "old" ways since that is what people are used to or modify the new way to support better methods.


If you ALWAYS push the Models from FPP Connect every time you make any controller change, then it will work. But let me give you an example of this:
You use FPP Connect to upload your models and then after that you make a minor change, like add another model somewhere. Since you didn't do much, you just used the Upload Output button in the controller page of xLights. Your previously uploaded Models could be incorrect in this case.

Quote from: madsci1016 on April 03, 2024, 10:33:48 AMand pushing models would continue that workflow
Only if you used FPP Connect for ALL controller configurations and don't use the Upload outputs in the controller page.

Quote from: madsci1016 on April 03, 2024, 10:33:48 AMMeaning i found a bug we'd want to fix, not a "you were using it wrong" type response.
It isn't a bug, and I didn't mean for it to come off as a "you were using it wrong" type response. There are many options and they all have a purpose and with so many options it is sometimes difficult to follow the rationale for all the options.

Quote from: madsci1016 on April 03, 2024, 10:33:48 AMI didn't need it for my use right now, I'm just asking to see if my understanding of this philosophy is correct or needs adjusted before i continue to teach new users about xlights and FPP.
Let me try and explain, and sorry if I am overly simplistic or make it even muddier.

An Overlay model is a representation of a block of channels that represent your model so that you can manipulate just that block of channels.

Originally xLights had the option to upload models to FPP based controllers so that you could now have model definitions to manipulate those specific blocks of channels for things like testing or effects. But this was an all or nothing setting. If you had one FPP device with 8 models and another FPP device with 15 models and you selected to upload models using FPP connect, both FPP devices would have definitions for 23 models, which was typically harmless but probably not efficient. 

But in order to keep these models correct, you HAD to re-upload your model configurations to ALL of your FPP devices if you made a change to ANY controller. You couldn't just re-upload the models for the controller that you made the changes on (I can explain this further if you want). 

This was a problem for many users and we had a lot of people reporting problems because things weren't working as expected and it was discovered that in many cases, they had the wrong Overlay Model defined. So, to try and "fix" this, the developers added the Auto Overlay Model option.
 
What the Auto Overlay Model option does, is that it will create and update "on the fly" the Overlay Model definitions based on the Pixel port configuration for that device so you will always have the correct Overlay Models defined for that controller without the need to upload anything (AKA more automated).

But there is still a need for uploading models using FPP Connect. For example, you might have an FPP as player only so there are no models assigned to any ports. There will not be any Auto Assigned models created. But you want your Player to either test a particular model that is on another controller or use an FPP Command or Plugin to control a model that is not connected locally. In that case, there would be a need to upload the Overlay Models from FPP Connect.

Within FPP, let me explain how the Overlay Models work. Like I mentioned, the Auto Overlay Models will be created based on the models connected directly to that device and the name of the Model will be whatever name is used in the description of that port and will typically be the name of the model in xLights.
When you upload models from FPP Connect, it will load model definitions based on the model name in xLights but this means that you will have two distinct models with the same name, but possibly not the same data and there are a few edge cases where this is needed. But FPP assumes that if you "manually" uploaded your overlay models, then this is the one that you really want to use.

All of this probably doesn't matter if you are always uploading models, but just information on how it works.


If to err is human, I am more human than most people.

madsci1016

Quote from: Poporacer on April 03, 2024, 12:21:33 PMThanks for the screenshot! They really help.

It looks like there might be some other things going on? (or a bug) Do you have more than one FPP device? The reason I ask is because the device you posted has the Auto Created Pixel Overlay models checked, but no models defined in that section...Can you clarify if you are using more than one FPP device in your situation? If you are not using more than one FPP Device, can you post a screenshot of the String output page?




This is a dev environment i am creating to use to teach classes at mini's this year. A single Dell computer with 6 VMs including FPP, Home Assistant, Frigate, etc. So only one FPP device in this "setup" and it has one output, which is 2 e131 universes to a pixel stick with 5 snowflakes. And thats it. Thats all there is to the show folder in xlights too. 

Only odd thing i'm doing is configuring 2 null pixels between each snowflake by just skipping channels (in xlights), since the controller can't do it itself. But that wouldn't affect the first snowflake which has no nulls ahead of it. 



Thanks (really) for that long explanation, i need to read it a few more time to digest it. 

CaptainMurdoch

I was able to reproduce the issue here with that config.  It had to do with the Pixel Overlay Model handling of the custom model and mapping the nodes to the channels.  I have a fix and will try to get it committed tonight after I get a chance to re-test.
-
Chris

Support FPP

+- Recent Topics

QN8066 FM Transmitter by aaronross
Today at 04:01:58 AM

Plugin for scoreboard data from node red by sharkboy005
July 16, 2025, 03:06:54 PM

Scoreboard Plugin by sharkboy005
July 16, 2025, 03:05:09 PM

Falcon 16v4 configuring to smart receivers by JonD
July 14, 2025, 05:26:28 AM

E1.31 Bridge Mode - Crash by Poporacer
July 13, 2025, 10:54:02 PM

E fuse api by Jrbrown
July 12, 2025, 08:06:48 PM

FPP VS eero home network Static IP challenges by JonD
July 11, 2025, 06:11:50 PM

Setting up a wired on demand show on Pi/ FPP to push a show to Falcon Controller by lunchour
July 03, 2025, 03:57:56 PM

ELM (Enttec LED Mapper) and FPP with bare RPi questions by ericjforman
July 02, 2025, 03:10:16 PM

xCapture Playback Issues by ericjforman
July 02, 2025, 11:38:48 AM

Powered by EzPortal
Powered by SMFPacks Menu Editor Mod