omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    Renault Zoe & Siri integration

    Pythonista
    6
    11
    4739
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • cvp
      cvp @Bod last edited by

      @Bod did you try shortcuts.set_spoken_output(text)

      1 Reply Last reply Reply Quote 0
      • Bod
        Bod last edited by

        That instruction is in there at the bottom of the script, but it only actions 'if shortcuts.is_shortcut():'

        I'm totally new to this, so don't really know what it is looking for to make the statement true.

        cvp 1 Reply Last reply Reply Quote 0
        • cvp
          cvp @Bod last edited by cvp

          @Bod you have to run your script via Siri, not in the Pythonista app.
          tap shortcuts
          tap > at right
          tap +
          tap add

          1 Reply Last reply Reply Quote 0
          • Bod
            Bod last edited by

            Ah !!! ... Thank you so very much.

            I didn't even see the + sign. Doh !!!

            It's working now, so all I have to do is alter the code to display miles instead of km.
            This should be fairly simple (i hope).

            1 Reply Last reply Reply Quote 0
            • Bod
              Bod last edited by ccc

              Right, I've figured where the KM value is & I've added a new line of code which takes the KM and divides by 1.6 which should give me a rough mileage conversion.

              Just need to figure out how to round it up neatly now.

              result = requests.get(url, headers=headers).json()
                convert = ({result['remaining_range']/1.6})
                if result['charging']:
                  minutes = result['remaining_time']
                  remaining = fuzzy_duration(minutes)
                  status = f"done charging in {remaining}"
                else:
                  status = "is not charging"
                return f"{carname} can go {convert} miles. Battery is {result['charge_level']}% full and {status}."
              

              I notice there is a programming tool called 'round', but I can't seem to get it to work.

              I tried convert = round ({result['remaining_range']/1.6})

              mikael 1 Reply Last reply Reply Quote 0
              • mikael
                mikael @Bod last edited by mikael

                @Bod, try:

                convert = round(result['remaining_range']/1.6)
                

                If result['remaining_range'] is actually a string, wrap it in float().

                1 Reply Last reply Reply Quote 0
                • Bod
                  Bod last edited by

                  Thank you, working perfectly now.

                  You are all amazingly helpful. Couldn't have solved this so quickly without all your help.

                  1 Reply Last reply Reply Quote 0
                  • renskempen
                    renskempen last edited by

                    Wow! Good work. Would be so great to have this!

                    But will it still work?

                    ~ % ping www.services.renault-ze.com
                    ping: cannot resolve www.services.renault-ze.com: Unknown host
                    
                    1 Reply Last reply Reply Quote 0
                    • ccc
                      ccc last edited by ccc

                      At the bottom of the blog entry above is the blog author's twitter handle. You might try tweeting him to see if he is willing to update his software.

                      1 Reply Last reply Reply Quote 0
                      • nhawk
                        nhawk last edited by

                        I'm the author of that blog post. I don't have a Renault Zoe anymore, but have a look if this repo helps: https://github.com/jamesremuscat/pyze

                        1 Reply Last reply Reply Quote 1
                        • First post
                          Last post
                        Powered by NodeBB Forums | Contributors