GithubHelp home page GithubHelp logo

Comments (9)

Nickduino avatar Nickduino commented on August 24, 2024

My instant feedback below, I'll try to sum-up what you want to do with my first input in a following post.

I haven't tested yet this project, but I was using a simple one which could open and close my Somfy blinds. So, your project seems to better, congratulations!

The other project was using a Raspberry Pi too? Do you have a link to it?

Using a timer, we can predict where the blinds are as the raspberry pi will send down/up and the code will know how long it takes to roll over. Easy I guess.

Easy-ish. You'll need to teach the script how long it takes to go up/down (probably not the same speed going up or down) for every blind, which needs creating a method for that, ideally adding it to the GUI, allowing the GUI to re-register it if necessary. Is the speed consistent with the seasons and sunlight (exterior temp)?

I am planning to develop an extension of your code to use the receiver 433Mhz to receive the original somfy remotes input. So, if someone uses the remote to put the blinds down/up, the raspberry pi will be able to receive this information and track the blinds position. Have you guys tried to use the receiver that comes together with the transmitter?

I personally use it for something else (get a notification when the mailman drops mail or a package). The good news is that pigpio can listen too and you'll access this functionality with a Python too. The other good news is that I'm 99.9% sure it will receive the codes from the real Somfy remotes because these receivers are reasonably tolerant frequency-wise.
If I reckon correctly, I even used it myself (plugged to an Arduino) to check the frames I sent were identical to the ones of a real remote (before you ask: nope, that sketch is lost forever).

I will also put this to work with HA, so everything will be manageable and automatized.

Excellent! We were contemplating the integration to a home automation solution but didn't know where to start as none of us use one...

from pi-somfy.

Nickduino avatar Nickduino commented on August 24, 2024

You say "easy" but I reckon your objective is somewhat ambitious. I would cut it into several different more-digest projects:

  1. Track the state of every blind
  2. Learn how to read the real remote
  3. Know where the sun is: PyEphem (that we already use to know sunrise/sunset) will help you track the sun: I assume knowing at what angle it will hit the window will help you decide how low you need the blind to be lowered.
    3bis. You can't live in the shade all year round. Protecting your windows (and inside temp) from the sun is useful only when the UV index is pretty high. The best free solution I've found for that is UVindex, which works nice with Python (https://github.com/bachya/pyopenuv/blob/bd6dd998d4f0b2e0ec017b6d1bf673fc5bfb5531/example.py) and will allow you 50 requests a day. I'll add a simple example to the next post.
  4. Include it to Home Automation.
  5. Change the GUI to include all that (state tracking, address of the actual Somfy remotes, what blinds they control, how much is too much UV, what sunrays angle is alright for what blind at what season, what elements to make available to HA, etc)

I would suggest to start including openUV to the current project (3bis) and use it to create conditions such as "if max UV index today is above 7, lower this blind and stop after 9 seconds". In my opinion, it's the simplest thing to do and will give you 90% of the functionality you are looking after.

1: That's useful and the elegant way of doing things but you can also create rules that lower a blind when the sun is blasting in the room and raise it back up afterwards.
2. You may never need this. I've noticed I never use any of my remotes...except at the heart of summer when I can't bear the heat. If you make the blinds smarter in august, you may never need to tough an actual remote ever again...not a priority at all
3. That seems overkill but pretty cool
4. Now, maybe you should start with that and do all the secret magic in HA (sun tracking etc.)?
5. This is a shit ton of work. The simplest the project, the less work the GUI will require

from pi-somfy.

Nickduino avatar Nickduino commented on August 24, 2024

As promised, the openUV example:

#!/usr/bin/python3

import asyncio
import pyopenuv
import sys

from aiohttp import ClientSession
from pyopenuv import Client
from pyopenuv.errors import OpenUvError

async def main(api, lat, lon, alt = 0):
try: #Create the aiohttp session and run the example.
async with ClientSession() as websession:
client = pyopenuv.Client(
api,
lat,
lon,
websession,
altitude=alt)
`

cur = await client.uv_index() # Get curent UV information
except OpenUvError as err:
print(err)

max = cur.get("result").get("uv_max") # Get the maximum UV index for the day
print("Maximum UV index today: " + str(max))
return max

asyncio.get_event_loop().run_until_complete(main(sys.argv[1],sys.argv[2],sys.argv[3]))
(Launch with python3 openUV.py "[API key]" lat lon)

You can also ask it the window of time during which SPF protection should be used:
print(await client.uv_protection_window())

from pi-somfy.

MichaelB2018 avatar MichaelB2018 commented on August 24, 2024

A few points:
1.) Partial lift and lower (based on timing) is already implemented:
image
I think we never updated the main screen shot...

2.) HA integration. We were discussing this a few time and the current thought is for an MQTT based (paho) implementation, maybe using discovery. I have a similar application using this and I was thinking of integrating this to Pi-Somfy. But if you think of a direct integration (not MQTT based), that would be great too.

3.) Receiver... That was the main reason why (2) was never been implemented. Unless we can capture the manual commands from the other remotes, HA in my case will usually state the wrong state, so pretty useless. If you can manage to solve the receiver, that would be great!

from pi-somfy.

matheuscanela avatar matheuscanela commented on August 24, 2024

Hey guys!
Thank you for all messages, I have been busy these days, but I will come back to implement this and let you guys know.

I have already cloned the repo :)

from pi-somfy.

MichaelB2018 avatar MichaelB2018 commented on August 24, 2024

Thinking of doing the mqtt integration sooner or later. Have you started. If mot, I was planning to close the alexa integration and add a "-m" option. Any thoughts? don't want to duplicate your work if you are almost ready.

from pi-somfy.

matheuscanela avatar matheuscanela commented on August 24, 2024

Hey mate, not yet, we had a baby who is consuming my time hahaha, but I will do

from pi-somfy.

MichaelB2018 avatar MichaelB2018 commented on August 24, 2024

congrats. no worries. I've done the mqtt integration and will test it the next week or so before publishing it.

from pi-somfy.

MichaelB2018 avatar MichaelB2018 commented on August 24, 2024

ended up checking it in already. Have a look when you find time. Also added some changes for Home Assistant's MQTT discovery, and made it look like one of the the newer ZWave "covers" that can set the level to a certain percentage. To do so, I had to make some changes to the timing functionality. But kept it backward compatible

from pi-somfy.

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.