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

Quinled brightness vs MQTT vs HA #1292

Closed
adrianmihalko opened this issue Oct 20, 2018 · 11 comments · Fixed by #1730
Closed

Quinled brightness vs MQTT vs HA #1292

adrianmihalko opened this issue Oct 20, 2018 · 11 comments · Fixed by #1730

Comments

@adrianmihalko
Copy link

adrianmihalko commented Oct 20, 2018

First, thank you for making this great firmware. I want to use it with Quinled. I am happy to see it's supported.

There are small issue what I found:

  • Brightness control is not added when I use auto discovery in Home Assistant, this part:
    brightness: true
    brightness_scale: 255
    brightness_command_topic: 'QUINLED-BED/brightness/set'
    brightness_state_topic: 'QUINLED-BED/brightness'

And I have one more question: what's the difference between setting brightness trough Brightness command vs. Channel #? Or I should leave both channels at maximum 255, then adjust brightness only with Brightness command?

screenshot 2018-10-20 at 14 46 46

Thank you,
Adrian

@ColinShorts
Copy link
Contributor

This might be related to #1222

@adrianmihalko
Copy link
Author

One more question/problem:

If I unplug espurna device, in HA device newer goes into unavailable state, and if was turned on it stay in state on. And this is problem. Is there any way to stay in sync?

@adrianmihalko
Copy link
Author

adrianmihalko commented Nov 13, 2018

@xoseperez

I have Quinled with single color LED at channel 0. Espurna does not respond to brightness commands via MQTT

QUINLED-BED/brightness/set

screenshot 2018-11-13 at 08 22 51

I checked Debug menu, but no command is received when I try to set brightness in this way.

If I set brightness via:

QUINLED-BED/channel/0/set

then it's working, but I have two channels and I want to keep channels at 255 and play only with brightness.

@ColinShorts
Copy link
Contributor

There are 2 channels, 0 and 1. These refer to the output channels of the device. As you've find, you change the brightness using the topic:

{$device}/channel/{$channel}/set

There's no need for a separate brightness topic for a simple dimmer.

@adrianmihalko
Copy link
Author

As you wrote there are 2 channels, #0 and #1:

screenshot 2018-11-13 at 12 26 00

All what I want is to leave both channels on 255 (100%) and adjust brightness with the Brightness command (bottom slider on the picture).

This is not possible?

@mcspr
Copy link
Collaborator

mcspr commented Nov 13, 2018

Easy test to see what device subscribes to is running mqtt.reset terminal command. It'll do reconnect routine and show all the topics.
(and it might be good idea to port this functionality straight into webui... as this came up multiple times)

Some code observations, as I cannot run this right now:

if (_light_has_color) {
mqttSubscribe(MQTT_TOPIC_BRIGHTNESS);

Device subscribes to brighness topic only when 'color' flag is set. Maybe it is not the case here? i.e. useColor setting is 0. Other codepaths do not do this e.g. websockets configure brightness regardless.

@xoseperez
Copy link
Owner

As @mcspr says, brightness setting controls the overall brightness of a set of RGB channels, that's why it's only defined when we have at least 3 channels and we defined them as color channels. Maybe it should be more generic and control any channel?

@stale
Copy link

stale bot commented Feb 7, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Feb 7, 2019
@mcspr mcspr removed the stale label Feb 8, 2019
@mcspr mcspr added this to the 1.13.5 milestone Feb 8, 2019
@mcspr mcspr added the enhancement New feature or request label Feb 8, 2019
@xoseperez xoseperez modified the milestones: 1.13.5, 1.15.0 Feb 24, 2019
@1043717432
Copy link

正如你所写,有2个频道,#0和#1

截图2018-11-13 at 12 26 00

我想要的就是将两个通道都放在255(100%)上并使用亮度命令调整亮度(图片上的底部滑块)。

这是不可能的?

This is my need. Have you solved the problem? Can you share the yaml file?

@mcspr
Copy link
Collaborator

mcspr commented Mar 18, 2019

All what I want is to leave both channels on 255 (100%) and adjust brightness with the Brightness command (bottom slider on the picture).

This is not possible?

IMO the color check should just be removed. webui already exposes the slider and _generateBrightness handles it by setting all channels to the same value.

Not sure how second channel can be described through HA mqtt.light logic

@copyrights
Copy link
Contributor

BTW: /brightness is already published, only subscription to /brightness/set is missing

here is what mosquitto logs after mqtt.reset:

1558352737: Received UNSUBSCRIBE from ESPURNA-XXXXXX
1558352737: 	#
1558352737: ESPURNA-XXXXXX #
1558352737: Sending UNSUBACK to ESPURNA-XXXXXX
1558352737: Received SUBSCRIBE from ESPURNA-XXXXXX
1558352737: 	QuinLED2/channel/+/set (QoS 0)
1558352737: ESPURNA-XXXXXX 0 QuinLED2/channel/+/set
1558352737: Sending SUBACK to ESPURNA-XXXXXX
1558352737: Received SUBSCRIBE from ESPURNA-XXXXXX
1558352737: 	QuinLED2/relay/+/set (QoS 0)
1558352737: ESPURNA-XXXXXX 0 QuinLED2/relay/+/set
1558352737: Sending SUBACK to ESPURNA-XXXXXX
1558352737: Received SUBSCRIBE from ESPURNA-XXXXXX
1558352737: 	QuinLED2/pulse/+/set (QoS 0)
1558352737: ESPURNA-XXXXXX 0 QuinLED2/pulse/+/set
1558352737: Sending SUBACK to ESPURNA-XXXXXX
1558352737: Received SUBSCRIBE from ESPURNA-XXXXXX
1558352737: 	QuinLED2/led/+/set (QoS 0)
1558352737: ESPURNA-XXXXXX 0 QuinLED2/led/+/set
1558352737: Sending SUBACK to ESPURNA-XXXXXX
1558352737: Received SUBSCRIBE from ESPURNA-XXXXXX
1558352737: 	QuinLED2/action/set (QoS 0)
1558352737: ESPURNA-XXXXXX 0 QuinLED2/action/set
1558352737: Sending SUBACK to ESPURNA-XXXXXX

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

Successfully merging a pull request may close this issue.

6 participants