-
Notifications
You must be signed in to change notification settings - Fork 145
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
[pimatic-lcd] Development / Discussion / Usage #271
Comments
Very nice, do you share the script? |
https://www.youtube.com/watch?v=zH_5zz72d30 Basicly I created a python script that split the arguments in 2 vars, and then display them as line1 and line2. No errorchecking at all for now. Will post script tommorow |
looks very promising! 👍 |
I find it amazing myself how easily it is to do with pimatic without writing an plugin :D Would be a good page for the guide :) |
This is the python script I made: from lcd_display import lcd
import sys
lines = str(sys.argv[1])
if lines == "off" :
my_lcd = lcd()
my_lcd.backlight_off();
quit()
if lines.find('~')==-1 :
lines = str.replace(lines, '_', ' ')
lineslen = len(lines)
if lineslen > 16 :
lines = lines[0:16]
my_lcd = lcd()
my_lcd.display_string(lines, 1)
else :
lines = str.replace(lines, '_', ' ')
line1, line2 = lines.split('~', 1)
line1len = len(line1)
line2len = len(line2)
if line1len > 16 :
line1 = line1[0:16]
if line2len > 16 :
line2 = line2[0:16]
my_lcd = lcd()
my_lcd.display_string(line1, 1)
my_lcd.display_string(line2, 2) If the first argument only is the word 'off' the it will turn the backlight off. I used this lib : http://www.gejanssen.com/howto/i2c_display_2004_raspberrypi/index.html#mozTocId243378 |
Thanks for sharing. PS: https://help.github.com/articles/github-flavored-markdown#syntax-highlighting |
Found it ;) Examples : To continues display the temperature, use something like this: |
Very nice, can be used as long as nobody has developed a "native" plugin. Another pro tip: Don't use |
The pimatic shell script plugin is really awesome and could replace many other scripts and plugins! |
@koffienl : did you use a logic level converter to connect the display to the raspberry i2c or don't you need it? |
Nope, you can directly connect it to the pi,thanks to the LCD I2C interface |
I just put all into a gitrepo to have all together, also did some changes so that it worked probably with my 4x20 display: https://github.com/sweetpi/python-i2c-lcd Maybe its usefull for someone. I will continue to play with: https://github.com/wilberforce/lcd-pcf8574 |
I made the LCD-node module pimatic ready: https://github.com/sweetpi/i2c-lcd |
Cool, I will try some. Not sure where and how to start yet :) |
|
Yes, it works :) |
Great, yes, I think its the startup time of node (JavaScript just-in-time compilation). |
Very nice! |
Confirmed working, great job! Awesome Noticed that all the characters that don' fit are lost. Maybe you can make line scroll when it is more then the characers that fit? |
Thanks, I had the same idea :) |
This is really really cool. Hope to finish some working stuff today where my LED pushbuttonns and LCD will all work together in pimatid :) |
actually i'm having a little time to play around with the pimatic-lcd plugin, but having an issue with the pimatic-lcd plugin. my lcd is a 1602 with adress 0x27 as i2cdetect confirms. the test.js output shows "raspberry pi" and switches to date and time. so i guess, this is all correctly installed. do i need to set the i2c adress of the display somewhere in the scripts or where could be the mistake? |
Pushed a update and published pimatic-lcd 0.8.2, which should fix the issue. I handled the case, that the text is too long to be displayed (cut-off) and the case that is is to short (pad with space), but did forget the case, where it fits exactly (just use the text!) :D. |
got it to work!! my fault - just forgot to add user pi to i2c group, that did the job ... |
hm... just wondering how to get this to work : having a switch connected to a lamp. how can i display a text on the lcd that shows "lamp on" or "lamp off" when switched? |
Do you have really a "." in your id? :D should work, see: http://pimatic.org/guide/usage/rules/ |
puuh ... sorry, thing i need to wake up now ;) sure it's pilight-funkdose1 ! thanks for your patience ^^ |
you should change the title of this issue to pimatic-lcd support for leader ^^ |
just tried with |
OK, then there should be a check in the plugin to allways turn on the LCD/backlight when displaying text :) |
as i wanted to update to pimatic-lcd 0.8.2 via gui i received this error information : |
I'm using the turn off and on in another way. I want to have it turned on when I'm sitting in front of it and turned of if I'm away, so I need to have explicit control over off and on (the lcd displays constantly informations). I will think about adding a "auto-mode" for the lcd backlight.
You can't update "git cloned" modules with npm. Run "git pull" inside the module or remove the module and restart pimatic to fetch the npm registry version. |
sorry, didn't know about that, thought it was an issue to the update system, since pimatic-lcd is relatively new. |
Finally got some stuff working: https://www.youtube.com/watch?v=xKKDnquih-0 What it does: I have a pushbutton (no physical on/off state) and a fake device (a variable). When the device is ON, the LED is full on, and the LCD displays it is on. The goal on this setup is, that the switch is not physical connected to something, only to pimatic. So you can use the button to switch a device on or off, but the device could also be switched on/off from rules or with the GUI. |
that's a very interesting and promising idea! |
Added a cool idea to the setup ;) When you press the button for at least 2 seconds, the LED ring wil blink 4 times (so you now the long press is detected) and it will turn the device on for xx time. |
there's one really annoying thing. everytime i do a reboot the lcd lights up and stays lighted until it is triggered from pimatic via rule. (can this be confirmed by anyone?) |
A condition for |
Would be really nice to have a option to detect if pimatic just has been started |
OMG! it's so simple ... ;) thanks for this hint!! it seems to work |
ehh what? I did not implement it yet... |
Would like to add a suggestion : Add a option to rules it they are permitted to run upon starting pimatic. With that option you put the load for one time at the framework instead of changing a lot of rules and adding it to the cron plugin. Asking this option has been on my whishlist, but hadn't much prio :) |
I solved my problem with a workaround using ping plugin. If raspberry-pi is present then display pimatic has started for 60 seconds. I put this rule on top of the rules list. Otherwise some other rule containing display text would overwrite the display output. That did the Job. Sure, an option for if pimatic has started would be better and could be usefull |
Cool idea. |
Reminder : if you want to use this plugin, edit you /etc/modules and add the following 2 lines:
After a reboot you can use your LCD. |
Hello everyone, i'd like to post the temperature on my 4x20 LCD. i2cdetect detects the LCD at /dev/i2c-1 0x27 Than i created a rule: -> just gives me the error: What am i doing wrong? Thanks a lot, |
did you install the lcd plugin?
after that you should be able to use the lcd like you have described above. good luck! |
Awesome!!! Deleting the pimatic-lcd folder and restarting the service did the trick! Thanks a lot :-) |
And another question: if i'm displaying something like |
make a rule like this |
sometimes the easiest solutions are the best.... |
Received my I2C 16x2 LCD today.
Took some time to get it working, but for now I can see status of a device on the LCD, directly controlled with pimatic :)
https://www.youtube.com/watch?v=t4Nu4YMaxwk
The text was updated successfully, but these errors were encountered: