Twinkly christmas lights integration

@Pavion Would you be willing to send the .jar file out? or post it?

It’s in the Release section on GitHub, just look on the right side (above link).

1 Like

Twinkly Binding

This is the OH3 fork of @Maarten_v_Hulsentop binding.
As of now it can switch your lights on and off, current state can be obtained by sending REFRESH to the corresponding channel. No fancy stuff :slight_smile:
Fancy stuff might be added on request :face_with_monocle:

Feedback appreciated! :slight_smile:

Hey @Pavion ,

Thank you for your message and your code. As you may be able to tell, this is my first OpenHAB binding. I did get a report last year from @mashborn that the binding did not work, but at that time i was still on the 2.x version so i could not reproduce.

I had been planning to work on the upgrade issue this year, as i have upgraded to OH3 myself as well, but you beat me to it. I am planning to do some updates on the binding as soon as the tree is up, but i am not really looking to bring many app features to the binding. The basic stuff suffices for my case. Also releasing to the github releases was on my todo to continue on my journey of learning about openhab bindings :slight_smile:

What are your plans with the binding? Do you plan on investing considerable time on it?

Thank you for your contribution!
Kind regards, Maarten

1 Like

Twinkly season is coming. Excited to see, if it’s still working after a year of updates.
On/off is most important - but therefore I could use a more cheaper decoration light with a switchable plug, too.
It would be great to enable the available effect scenes by name from rules: At different times per day I prefer different effects and on weekends there’s more time in the living area than on work days…

Michael

Hi. Thanks a lot for a great binding.
@Pavion Could you please build it with playlist mode? Or probably someone can implement configurable modes? Because now it just shows last effect only.

off - turns off lights
color - shows a static color
demo - starts predefined sequence of effects that are changed after few seconds
movie - plays predefined or uploaded effect. If movie hasn’t been set (yet) code 1104 is returned.
rt - receive effect in real time
effect - plays effect with effect_id
playlist - plays a movie from a playlist. Since firmware version 2.5.6.

sure, I’ll take a look tomorrow

Hu @svh! Please check the latest release (see link in the post #40 above) for mode support.
Feedback appreciated.
BR Pav

Hi @mashborn, sorry I’ve overlooked your post until now.
If you could provide some usage examples, I can implement it at will.
I’ve now added mode support which allows to turn on the last effect, an additional Number channel for numeric effect selection could be added (API).

Hi @Pavion .
Just installed your latest version and playing around.
Works great.
If I set mode to effects how to select the effect?

Michael

Just a moment… I’m testing it already :slight_smile:

Hi Pavion. Thank you for the change, but i didn’t get how to use it :slight_smile:
I saw in the code default mode set (the part which turns it on) TwinklyTreeHandler.java
82 } else if (OnOffType.ON.equals(command)) {
83 setMode(“movie”);
84 updateState(channelUID, OnOffType.ON);
I thought we can change it there but seems you did it differently.
Could you please describe in more details how to set it in your implementation?

I’m still trying to understand the implementation myself.
As far as I can see, I can use my app to add some movies / effects to a playlist.
This playlist can then be uploaded to the lights as a list (max. 15).
After that I’m able to select an effect by specifying its id.
Would it be sufficient? I’m still testing it.

Now, when i turn it from the application, it starts playing all effects from my saved list one by one and it’s fine for me.
From the documentation i found out this is playlist mode. I believe it would be great to have some kind of selector where you can choose default mode. And this mode should be passed to the switch on routine. You can add demo, movie and playlist modes for now since they don’t require additional parameters and it would be much easier to start with.

Well you can already map the mode channel, which hat predefined values (“playlist”, “movie” and so on, see API / release notes). You can send a corresponding value per rule.

Current development:

  • movie support:
    • upload several movies from your app to your lights
    • switch mode to “movie”
    • send a corresponding id of uploaded movie (same order as in the app) to activate this movie
  • automatic channel refresh (with fixed delay of 60 seconds)
  • automatic reconnect on fail to avoid exceptions

I’ll draft a new release in some minutes.

1 Like

So I’ve just drafted a new release with shiny new adjustable refresh rate.
Gonna do some other stuff for a while, feedback appreciated! :slight_smile:

Thanks a lot. Works fine. :slight_smile:

1 Like

@Pavion i installed my tree (including lights) today, and i must say it works pretty well now :slight_smile: Great job updating the code to OH3 and extending it!

I notice your pace is way faster then mine, i do not have much time to do development, so it makes most sense that you take it over. If possible, maybe i’ll add join in during the holidays. :slight_smile:

2 Likes

Thanks for providing a solid foundation and you’re most welcome to contribute! :slight_smile:

Hello together!
I’ve created a new thread in Marketplace to attract some more attention just before Christmas hits :christmas_tree:
Please join in! :slight_smile:

BR Pav

2 Likes